The Atlantis is a new music venue opening in DC this summer with a great lineup of 44 ‘inaugural’ shows, including the Foo Fighters, Third Eye Blind, and Maggie Rogers.
To get ready for the lineup, I wanted to make a Spotify playlist featuring these artists. But that seemed like it would take a long time: I’d have to look at the lineup poster, type in the artist’s name, then add songs to a playlist. Rinse and repeat 43 more times.
I was determined to automate this process… even if setting up the automation took longer than the cumulative manual drudgery of making the playlist (which it probably did).
Here is the result:
And here is the script: Link to Google Colab Python notebook
My approach:
I used Spotipy (a Python wrapper for the Spotify Web API) to build the playlist by compiling songs from each individual artists feature playlist (e.g. ‘This is Drive-By Truckers’, ‘This is Rainbow Kitten Surprise’):
Step 1 (prior to the coding part): I used an OCR screenshot tool (CleanShot X) to pull the names off the poster and paste them into a spreadsheet.
Step 2: Upload the spreadsheet into the Google Colab environment as a Pandas DataFrame
Step 3: authenticate into Spotify Web API w/ the proper access
Step 4: Create the new playlist
Step 5: Iterate through the DataFrame of artists and search Spotify for ‘This is [insert artist name]” playlist. Grab the top results and add all songs from that playlist to the new playlist
There you have it! We made a 123 hour long playlist in like a minute!
Commentary:
Getting the proper access code working with the Spotify Web API was my biggest hurdle.
I accidentally added Xzibit songs to the playlist instead of the artist “X” because when the API searched for “This is X” playlist, Xzibit outranked them. Too bad they couldn’t book Xzibit :(