A tool to discover your Spotify using Spotify's API based on Spotipy
- Generate new playlists based on recommendations (Spotify for Developers: Recommendations)
- Create a fancy overview of your top tracks and artists
This script will generate an HTML file with a representation of your top tracks/artists over a period of time. An overview looks like this:
Hovering over a picture shows a more detailed view:
A list shows the ranking of the tracks/artists and the popularity1 rated by Spotify:
Documentation will be added soon.
Install requirements using pip install -r requirements.txt
- Follow the steps on Spotify for Developers: Getting started with Web API until you have a Client ID and a Client Secret. Add http://localhost as "Redirect URI" in your application.
- Add your Client ID and Client Secret to the credentials.json file
The following scripts are independent of each other except for the API Token generation since it is needed for running every script.
You need a valid token which is generated by the get_token.py file to use the Spotify API. A token is valid for one hour. To generate it, run the file and paste the URL from the browser into the input. Sometimes Spotipy does not ask for the URL and just creates the token.
- Create an API token
- Open generate_pic_overview.ipynb and adapt the first code block:
TYPE
: The type of entity to return.1track
: Get top tracksartist
: Get top artists
TIME_RANGE
: Over what time frame the affinities are computed.1short_term
: Last 4 Weeksmedium_term
: Last 6 Monthslong_term
: All Time
LIMIT
: The maximum amount of top items. The maximun was set to 50 by Spotify. It is possible, that Spotify does not return 50 items and the overview is therefore smaller.- Number from 1 to 50
- Run the complete notebook and see generated HTML file in the folder named
generated
.
Documentation will be added soon.