Spotify in Python Part 1: Preprocessing

Rubentak
8 min readApr 24, 2023

In this article, we will get started getting your Spotify data into Python. This will be the first article in a series of articles on Spotify in Python.

In this article, I will:

  • Show you how to get your Spotify data into Python.
  • Load your Saved Songs playlist into a data frame.
  • Get the audio features off all your saved songs.
  • Add a genre (group) to each song.
  • Give a small conclusion and talk about the next steps.

Credentials

To start with, your user Spotify API credentials are needed.

In order to do this, you’ll need to follow these steps:

  1. Go to the Spotify Developer Dashboard (https://developer.spotify.com/dashboard/applications) and log in with your Spotify account.
  2. Click on the “Create an App” button to create a new Spotify application.
  3. Fill in the required information for your application, such as the name, description, and website. You can set the “Redirect URIs” field to the URL you want to use as a redirect URL.
  4. After creating the application, you will be provided with the “Client ID” and “Client Secret” values.
  5. Make sure to also set…

--

--

Rubentak

Co-Founder of RSLT LAB, Big Data and AI Solutions Graduate, Entrepreneur, and Data Science enthusiast