Code Monkey home page Code Monkey logo

data-pipeline-airflow's Introduction

Description

Sparkify wants to analyze the data they've been collecting on songs and user activity on their new music streaming app. the analytics team is particularly interested in understanding what songs users are listening to. I create a database schema and ETL pipeline using Airflow for this analysis to be optimized for queries on song play analysis. Using the song and log datasets

Database Design

Fact Table

songplays - records in log data associated with song plays i.e. records with page NextSong songplay_id, start_time, user_id, level, song_id, artist_id, session_id, location, user_agent

Dimension Tables

users - users in the app user_id, first_name, last_name, gender, level

songs - songs in music database song_id, title, artist_id, year, duration

artists - artists in music database artist_id, name, location, latitude, longitude

time - timestamps of records in songplays broken down into specific units start_time, hour, day, week, month, year, weekday

ETL Process

build an ETL pipeline using Python . reading data from log files from directories data\song_data and data\log_data,insert them into staging tables in Redshift then from staging table to fact table and Dimension tables

Project files

dags folder

1.sql_quieres.py : contains all sql quieres i needed in project 2.udac_example.py: contains the main code for Dag i used in my project

pligins folder--operation folder

1.data_quality.py implement of DataQualityOperator to check quality of the data ( usesd in Dag) 2. loaddminsions.py implement of LoadDimensionOperator to load data from staging tables to dimention tables(used in Dag) 3. loadfact.py implement of LoadFactOperator to load data from staging tables to fact table(used in Dag) 4. stage_redshift.py implement of StageToRedshiftOperato to load data from s3 backet to staging tables(used in Dag)

README.md provides discussion on your project.

How To Run the Project

run from Airflow according to schedule

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.