Code Monkey home page Code Monkey logo

song_play_analysis's Introduction

Song Play Analysis

Introduction

This project aims analyse data from song plays based on user interaction, think of Spotify. In this project we create a star schema database model to best connect and understand our data. To achieve this goal we create a suitable database shema with a ETL pipeline.

Database schema

The schema can be quickly visualized by opening up the index.html under doc/sparkifydb.

This database schema encompasses the following tables from two distinct data sets to lastly form a fact table:

  1. song dataset:
    • song table: dimensional table that contains data from the available songs such as year, duration, title, song ID (PK) and artist ID (FK);
    • artists table: dimensional table contains data related to the artists from the songs such as artist ID (PK), artist name, and artist's latitude and logitude;
  2. log dataset (data refers to user interaction data):
    • time table: dimensional table containing data related to the times when users when users were listening to music;
    • users table: dimensional table containing user data such as first and last name, gender and subscription level.

Lastly, the fact table that gathers the data from these two data sets is called songplay table. It contains FKs such as artist Id, song Id and user Id, as well as timestamp of when the song was played and location.

Setup

  1. Install python 3.x.x ;
  2. Install and run postgres ;
  3. Create a database called sparkifydb ;
  4. Run python create_tables.py on the root of the project in order to create, and drop if they exist, the necessary tables
  5. Run python etl.py to fulfill the project requirements and fill up the tables

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.