Giter Club home page Giter Club logo

postgresql-etl-pipeline's Introduction

Purpose.

A (hypothetical) music streaming startup, Sparkify, wants to better analyze their data gathered from their app. I designed and implemented this database to enable easy querying of what songs are being listened to, who is listening to them, and general information about songs and artist.

Justification.

I created a PostgreSQL database of user and song analytics as well as an ETL pipeline using Python to populate the database from JSON logs and metadata. The database uses a star schema which focuses on what songs are being played and by what users. Once this database is populated, queries can provide the analytics team with useful information about the listener like name, account level, gender, and listening location. Queries can also provide information about the song or artist, such as the artists location, or the duration of the song.

Files

create_tables.py connects to the Sparkify database and drops any tables currently existing. It then creates all the necessary tables in the database. etl.py will walk through the directories of data and insert song and log data into their respective tables. Both of these files also reference sql_queries.py which includes strings of SQL code used for operations such as dropping or creating tables, inserting data, or joining tables. etl.ipynb is a Jupyter notebook used for developing the fundamentals of the etl pipeline implemented in ety.py. test.ipynb is a Jupyter notebook which can quickly identify that the database is inserting the correct data into the correct tables. The data folder includes directories of the song and user listening data in JSON format.

How to Run Scripts

In order to run these programs, first create_tables.py must be run to create the necessary tables for the database to use. Then, etl.py can be run to finish creating the database. This functionality can be verified by running the code in the test.ipynb notebook.

postgresql-etl-pipeline's People

Contributors

leviob avatar

Watchers

 avatar

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.