Skip to content

This project is the implementation of a script that generates a Spotify playlist based on an input of a song by the user, using an object oriented approach.

License

Notifications You must be signed in to change notification settings

HZloto/instant-playlist

Repository files navigation

LinkedIn


INSTANT PLAYLIST

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

·

Report Bug

·

Table of Contents

  1. About The Project

  2. Getting Started

  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

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.

(back to top)

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

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

Installation

  1. Get a free API Key at https://developer.spotify.com/dashboard/

  2. Clone the repo

git clone https://github.com/HZloto/instant-playlist.git
  1. 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

(back to top)

Usage

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

(back to top)

Framework

The flowchart below shows the relation between the scripts. alt-text

  • 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.

(back to top)

Contributing

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!

  1. Fork the Project

  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)

  3. Commit your Changes (git commit -m 'Add some AmazingFeature')

  4. Push to the Branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Hugo Zlotowski - [email protected]

(back to top)

Acknowledgments

This app was developed for educational purposes with the following team:

  • Demi Vinke

  • Chris Cauchi

  • Martin Garica

  • Juan Esteban Perez Isaza

(back to top)

About

This project is the implementation of a script that generates a Spotify playlist based on an input of a song by the user, using an object oriented approach.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages