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.
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.
This is taken from GitHub (@cetinsamet/music-genre-classification)
All credits go to him for making this amazing repo possible.
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 of this project is available here. The original version of that playlist is proguy's playlist.
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
- Clone this repository (it might take some time depending on your internet speed).
git clone https://github.com/OpenRobot/spotify-music-genre
- Install the required dependencies (Note. It is recommended to use a venv instead).
pip install -U -r requirements.txt
- Copy
config.example.py
to the root folder of the repository, namedconfig.py
. - Insert all the values for the essential variables. This includes:
SPOTIFY_PLAYLIST_ID
SPOTIFY_CLIENT_ID
SPOTIFY_CLIENT_SECRET
- Run the script.
python3 main.py
- Follow the instructions in your terminal.
If you are searching for the dataset used here and you would like to download it, you can find it here