You can find all the documentation to use Spotipy and add features here
Spotipy will need to be installed for this to work. It can be done through an IDE such as PyCharm or by using these commands.
pip install spotipy
or
pip install spotipy --upgrade
The first thing you need to do is create an app on https://developer.spotify.com/
This will provide you with three essential environment variables that we need to set:
SPOTIPY_CLIENT_ID
which will be the client ID on the Spotify app
SPOTIPY_CLIENT_SECRET
which can also be found on the Spotify developer page
SPOTIPY_REDIRECT_URI
which will be set on the developer page (usually a localhost such as http://localhost:8888/callback)
Use the export
command to set these variables. Another option is to edit the configuration on your IDE and set the envrionment variables there.
export SPOTIPY_CLIENT_ID <Client ID>
export SPOTIPY_CLIENT_SECRET <Client Secret>
export SPOTIPY_REDIRECT_URI <Redirect URI>
This should be everything you need to run the scripts and use the various features
When using a Spotify listening party, people will queue numerous songs at once and this usually means you end up listening to one person's songs for a while.
With this script each person can enter a list of song names and it will play one song from each person's queue one at a time.
If you really like the current artist you're listening to you can use this script which will take the current artist you're listening to, find a song by them in your playlist and queue it next.
Creates a playlist based on the last 5 songs you listened to, you can choose how many songs are added (Max 50) and whether you want to add to an existing playlist or create a new one.
You can get statistics about a playlist or about the 5 most recent songs you listened to. Statistics include:
- danceability
- energy
- key
- loudness
- speechiness
- acousticness
- instrumentalness
- liveness
- valence
- tempo