Skip to content

A personal project built in Python to organize my Spotify playlists by language or genre. It uses artist metadata stored in CSV files and automatic detection with the Spotify and AudD APIs.

Notifications You must be signed in to change notification settings

cotibodereau/SortifyAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify Playlist Organizer

This is a Python tool I built to organize my own Spotify playlists by language or genre.

It connects to my Spotify account, analyzes the tracks in a playlist, and creates a new one sorted by the selected criterion. It uses:

  • The Spotify Web API to access artist and track metadata
  • The AudD API to detect lyrics language
  • CSV files to store known artist-language and artist-genre mappings for future use

How it works

  1. You choose a playlist and whether to sort it by language or genre.
  2. The script builds a new playlist in your Spotify account with the songs sorted accordingly.
  3. Artist metadata is saved locally so detection improves over time.

How to use it

  1. Clone this repository and install the dependencies:
    pip install spotipy python-dotenv requests pandas langdetect pycountry
    
  2. Create a .env file in the root directory with your credentials:
    SPOTIPY_CLIENT_ID=your_spotify_client_id
    SPOTIPY_CLIENT_SECRET=your_spotify_client_secret
    SPOTIPY_REDIRECT_URI=http://127.0.0.1:8888/callback
    AUDD_API_KEY=your_audd_api_key
    
  3. Run the script:
    python main.py
  4. Follow the prompts in the terminal to choose a playlist and how you want to sort it.

Organizador de Playlists de Spotify

Esta es una herramienta en Python que desarrollé para organizar mis playlists de Spotify por idioma o género.

Se conecta a mi cuenta de Spotify, analiza las canciones de una playlist, y crea una nueva con las canciones ordenadas según el criterio que elija. Utiliza:

  • La API de Spotify para acceder a metadatos de artistas y canciones
  • La API de AudD para detectar el idioma de las letras
  • Archivos CSV para guardar los géneros e idiomas ya conocidos por artista

Cómo funciona

  1. Elegís una playlist y si querés ordenarla por idioma o género.
  2. El script crea una nueva playlist ordenada dentro de tu cuenta de Spotify.
  3. Los datos de los artistas se guardan localmente, por lo que la detección mejora con el uso.

Cómo usarlo

  1. Cloná este repositorio e instalá las dependencias:
    pip install spotipy python-dotenv requests pandas langdetect pycountry
  2. Creá un archivo .env con tus credenciales:
    SPOTIPY_CLIENT_ID=your_spotify_client_id
    SPOTIPY_CLIENT_SECRET=your_spotify_client_secret
    SPOTIPY_REDIRECT_URI=http://127.0.0.1:8888/callback
    AUDD_API_KEY=your_audd_api_key
  3. Ejecutá el script:
    python main.py
  4. Seguí las instrucciones en la terminal para elegir una playlist y cómo querés ordenarla.

About

A personal project built in Python to organize my Spotify playlists by language or genre. It uses artist metadata stored in CSV files and automatic detection with the Spotify and AudD APIs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages