Inspiration
We both love listening to music, especially through Spotify, and creating playlists that are suited to our taste and moods. By combining our passion for music and technology, we thought it was a perfect idea to use Spotify to create new playlists that are dependent on our mood. We wanted to possibly help others who may be indecisive or have trouble with technology to curate their own playlist tailored to the keyword that they want their playlist to be themed around.
What it does
Our project will generate a Spotify playlist based on the user-inputted keyword, which can be a genre, artist, or feeling/vibe. It will numerically list the songs with the song name and the artist name and create a new file with the playlist information.
How we built it
We used Spotify's API (which accessed their data through a token) and took playlists, tracks, artists, and genre data. In order to make this curated playlist, we created a for loop that sifted through playlists with the keyword and randomly chose songs from these playlists to be in our new curated playlist. We made sure to not have any repeats of songs, which required an if statement, so it could be as authentic as a user-made playlist.
Challenges we ran into
Scraping through the json information to find song name and artist (syntax) to add into lists / pulling the playlists' name data from the entire playlist data (lines 38-49).
We wanted to implement an actual link to the curated Spotify playlist instead of a list of the songs in the terminal + file. However, the code could not create a playlist with our token (within the hackathon time period) and therefore, we could not go further in this process of adding the links of the songs to the playlist in Spotify.
Accomplishments that we're proud of
We were able to create a token, use Spotify's API, and access Spotify's data. Using that data, we could curate a playlist for the user's needs. We believe this is an accomplishment because we have not dealt coding APIs (using token, etc), but instead used applications like code.org to use the (cleaned) data from other companies. Additionally, Spotify's data was very complex and lengthy, but we were able to compile certain aspects of the data such as the urls of the songs, the artist name of the songs, and the song name. This took multiple tries as the formatting of the wording was important for the code to work.
What we learned
We learned how to implicate more complex elements of Python and APIs.
What's next for Spotify Playlist Curator
If we had more time, we would definitely add the link to the curated playlist in Spotify's application / have the code make a playlist within Spotify that had the curated songs.
Log in or sign up for Devpost to join the conversation.