Giter Site home page Giter Site logo

spotify-etl's Introduction

Spotify-ETL

The main_.py file uses this endpoint to extract the most Recent Played Tracks out of the spotify API. After performing the extraction, I performed a basic clean-up of the data extracted as well as creating a unique identifier for the load-up of my dataframe to a PostgreSQL database, for which I used SQL.

Extraction

The data was extracted using the spotify API mentioned up above to get the most recent 20 played tracks in spotify by sending a request to the API. The result of this is a .json response stored in the response variable, this dictionary was used to extract specific values out of our response to create a dictionary with all of our data and then, appending it to a list to be later converted to a DataFrame using pandas.

Transforming

The transformation of my dataframe consisted of some basic checks here and there, starting by converting my list to a dataframe, re-ordering the dataframe columns and changing the dataype of datetime, date & time.

Loading to PostgreSQL

Now that we are done with our basic checks using pandas, we use the psycopg2 library to create a connection to an existing database in postgreSQL, starting by creating a table with a unique_identifier along with our key values according to what we've got in our DataFrame. Last but no least, in order to load the Dataframe to our table called spotify, we have to create an engine using the sqlalchemy libray to append my existing dataframe to such table.

imagen

spotify-etl's People

Contributors

cesalomx 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.