Skip to content

natdosan/Spotify-Persona-Clustering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ONGOING - Spotify-Persona-Clustering

This project is in its beginning stages. For an overview, click here

This project uses the Spotify API to retrieve audio features for a given list of tracks. The most relevant section for the Supervised/Unsupervised Learning performed can be found here

Spotify API

The Spotify API is a powerful tool that allows developers to access a vast collection of music data, including audio features, artist information, and track metadata. To use the Spotify API in your project, you will need to register your application with Spotify and obtain an access token. You can find detailed documentation and examples on the Spotify Developer Website.

Authentication

To authenticate your requests to the Spotify API, you will need to include an access token in your requests. You can obtain an access token by following the Authorization Code Flow or the Implicit Grant Flow depending on your use case.

Endpoints

The Spotify API provides a wide range of endpoints that allow you to retrieve and manipulate music data. Some of the most commonly used endpoints include:

  • GET /v1/tracks/{id} - Retrieve a track by its Spotify ID
  • GET /v1/audio-features/{id} - Retrieve audio features for a track by its Spotify ID
  • GET /v1/playlists/{playlist_id}/tracks - Retrieve the tracks in a playlist by its Spotify ID

You can find the full list of endpoints and their documentation on the Spotify Developer Website.

Structure

Spotify Persona Clustering
├── code
│   ├── data
│   │    ├── README.md
│   │    ├── songs.csv
│   │    │ 
│   │    └── features.csv
│   │    
│   └── src
│        ├── README.md
│        ├── environment.yml
│        ├── preprocess
│        │        ├── scrape_spotify.py
│        │        ├── preprocess.py
│        │        ├── preprocess.ipynb
│        │        └── pca.py
│        │     
│        ├── supervised
│        │        └── knn.ipynb
│        └── unsupervised
│                 └── kmeans.ipynb
├── LICENSE
├── requirements.txt
└── README.md

Usage

Please make sure all requirements and dependencies are installed in order for proper usage.

Install

clone the repository

git clone https://github.com/natdosan/Spotify-Persona-Clustering

Go the repository directory, switch the branch if running branch other than master

cd Spotify-Persona-Clustering
git checkout <branch you'd like to run>

Create conda environment and activate it

cd front-end-vis
conda env create -f environment.MacOS.Linux.yml
conda activate Spotify