The following scripts parse through your own playlist(s) and extracts the most popular songs based on popularity data from Spotify and Genius. This includes ranking where the most popular song will be placed on top of the playlist followed by the rest of the songs in descending order of popularity. If you want to extract the 100 (or any other number) most popular tracks from your favorite playlist, this script can help you out! A few modifications are needed to make it work in your personal environment.
The first step necessary is to make an account that links your Spotify account to a developer account. This can be done through the following link: https://developer.spotify.com/dashboard/. This account will provide you with a client id and a client key. Both are necessary to allow the program to run and extract data from your personal Spotify account within the limitations set by Spotify and is needed in the script: extract_and_analyze_data_from_playlist.py. In addition, we also need authorization to actually access and edit our Spotify data when we are adding a playlist and appending tracks to the playlist. To this end, we need a key dedicated to editing personal information which can be obtained here: https://developer.spotify.com/console/post-playlists/.
You will need to fill out some personal Spotify data and edit some parameters to get the script to work. Everything you have to fill in manually, is indicated by double curly brackets like this: {{PARAMETER}}.