Skip to content

A Tool to create new playlists based on their genre in Spotify from another Spotify playlist using Spotify API, AI, PyTorch and Python.

License

Notifications You must be signed in to change notification settings

YodaBotOS/spotify-genre-sorter

Repository files navigation

Spotify Music Genre

This repo uses Python with the Spotify API and OAuth2 to generate a playlist of songs based on the genre and creates a new playlist for that specific genre.

⚠️ WARNING ⚠️

This project is still a Work In Progress, which means there will be a lot of bugs and unexpected things.

Feel free to experiment with this repo and report any issues you find.

PRs are always welcomed.

Credits:

This is taken from GitHub (@cetinsamet/music-genre-classification)

All credits go to him for making this amazing repo possible.

Deploying Serverless (AWS Lambda):

You can use @proguy914629bot/smg-serverless-lambda. This repo is optimized specifically for serverless genre classification.

*Note: The Spotify Computing is still hosted locally, but the AI (PyTorch) to classify genres is hosted on the AWS Lambda Function.

A live demo:

A live demo of this project is available here. The original version of that playlist is proguy's playlist.

Setup:

The below steps assumed you already have fulfilled the following requirements:

  • You have installed Python3.10 or above with pip in your computer.
  • You have Git installed in your computer. (Most OS comes with git built in, especially Linux distros)
  • A Spotify API Client ID and Secret
  1. Clone this repository (it might take some time depending on your internet speed).
git clone https://github.com/OpenRobot/spotify-music-genre
  1. Install the required dependencies (Note. It is recommended to use a venv instead).
pip install -U -r requirements.txt
  1. Copy config.example.py to the root folder of the repository, named config.py.
  2. Insert all the values for the essential variables. This includes:
    • SPOTIFY_PLAYLIST_ID
    • SPOTIFY_CLIENT_ID
    • SPOTIFY_CLIENT_SECRET
  3. Run the script.
python3 main.py
  1. Follow the instructions in your terminal.

Downloading the default dataset:

If you are searching for the dataset used here and you would like to download it, you can find it here

About

A Tool to create new playlists based on their genre in Spotify from another Spotify playlist using Spotify API, AI, PyTorch and Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages