Skip to content

joriscaloud/d2sp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discogs to Spotify Playlist Sync

Sync your Discogs collection/wantlist to Spotify playlists with AI-powered curation using ChatGPT.

Quick Start

  1. Install dependencies:
pip install -r requirements.txt
  1. Setup credentials:

Create a .env file:

# Discogs API (get from https://www.discogs.com/settings/developers)
DISCOGS_CONSUMER_KEY=your_key
DISCOGS_CONSUMER_SECRET=your_secret
DISCOGS_USER_TOKEN=your_token
DISCOGS_USERNAME=your_username

# Spotify API (get from https://developer.spotify.com/dashboard)
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:8888/callback
SPOTIFY_USER_ID=your_spotify_user_id

# OpenAI API (get from https://platform.openai.com/api-keys)
OPENAI_API_KEY=your_openai_api_key

Usage

Basic sync (ChatGPT creates genre-based playlists):

./sync.sh

Options:

./sync.sh \
  --source [collection|wantlist|all] \
  --strategy [genre|decade|artist|custom] \
  --dry-run \
  --public

Examples:

# Preview playlists without creating them
./sync.sh --dry-run

# Create decade-based playlists from collection only
./sync.sh --source collection --strategy decade

# Create private playlists with custom curation
./sync.sh --strategy custom --private

Alternative: You can also run directly with:

python -m src.cli sync [OPTIONS]

How It Works

  1. Fetches your Discogs collection/wantlist
  2. Enriches metadata with YouTube Music play counts
  3. Matches albums and tracks on Spotify
  4. Sends all track data to ChatGPT (GPT-4o)
  5. ChatGPT curates playlists based on:
    • Genres, styles, decades
    • Popularity scores and play counts
    • Your preferred strategy (genre/decade/artist/custom)
    • Musical coherence and diversity
  6. ChatGPT creates playlists directly on Spotify using function calling

Why ChatGPT?

  • Intelligent curation: Context-aware track selection
  • Creative themes: Beyond simple genre grouping
  • Quality over quantity: Selects tracks that work well together
  • Engaging descriptions: Generates meaningful playlist descriptions

Cache

Data is cached in ~/.cache/discogs-sync/ to speed up runs and respect API limits.

To clear: rm -rf ~/.cache/discogs-sync/

Output

  • not_found.json - Albums that couldn't be matched on Spotify

Requirements

  • Python 3.12+
  • Discogs API credentials
  • Spotify API credentials
  • OpenAI API key (for ChatGPT-whatever-works-best--to-be-tested)

Commands

Sync playlists

python -m src.cli sync [OPTIONS]

Clear cache

python -m src.cli clear-cache

About

Creating Spotify Playlists From Your Discogs Account, With ChatGPT's Spotify App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors