An open source playlist recommender system for spotify based on the user input of one song.
View Demo _Note: Server is live but stateless. To use the app, please run streamlit on your local machine
·
·
Instant playlist replicates the way most music recommender systems work at a simpler scale. The app uses a mix of Collaborative filtering and Feature analysis to recommend a playlist based on a given song input. We first use user similarities to find groups of artist like the one we picked, then leverage the Spotify feature analysis to find the tracks that are most similar.
To get a local copy up and running follow these simple steps.
Any version of Python 3 will work with the project, but some libraries need to be downloaded. They are listed below:
- Pandas
- html_to_json
- spotipy
- scipy
- streamlit
#Run the below code in your terminal
pip install pandas
pip install html_to_json==2.0.0
pip install spotipy==2.20.0
pip install scipy==1.8.1
pip install streamlit
-
Get a free API Key at https://developer.spotify.com/dashboard/
-
Clone the repo
git clone https://github.com/HZloto/instant-playlist.git
- Input your Spotify API keys
Change all references to client_id
and client_secret
to your credentials in main.py
, database.py
and playlist_API.py
To use the app, type in your terminal:
streamlit run visual_interface.py
You will be redirected to the in-browser app. Enter an artist, pick a song, and wait for the Spotify URL of your playlist to be returned!
Our teacher is a fan of Muse. Find the playlist created for him HERE
The flowchart below shows the relation between the scripts.
-
Visual Interface
-
Using open source app framework streamlit, generate a dynamic page for the user
-
Scrapper
-
Crawl a website that offers similar artists to an input using requests and json
-
Input API
-
Using spotify API the ID of the artist is retrieved and passed to the next steps
-
Database
-
Using API endpoints to get top 5 songs of all similar artists and their features.
-
Recommender
-
Using spatial distance between user-picked song and each of the selected artist’s songs. Powered by scipy.
-
Playlist API
-
This script creates a public playlist and afterwards adds the 50 recommended songs to it.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
-
Fork the Project
-
Create your Feature Branch (
git checkout -b feature/AmazingFeature
) -
Commit your Changes (
git commit -m 'Add some AmazingFeature'
) -
Push to the Branch (
git push origin feature/AmazingFeature
) -
Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Hugo Zlotowski - [email protected]
This app was developed for educational purposes with the following team: