Sync your Discogs collection/wantlist to Spotify playlists with AI-powered curation using ChatGPT.
- Install dependencies:
pip install -r requirements.txt- 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./sync.sh./sync.sh \
--source [collection|wantlist|all] \
--strategy [genre|decade|artist|custom] \
--dry-run \
--publicExamples:
# 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 --privateAlternative: You can also run directly with:
python -m src.cli sync [OPTIONS]- Fetches your Discogs collection/wantlist
- Enriches metadata with YouTube Music play counts
- Matches albums and tracks on Spotify
- Sends all track data to ChatGPT (GPT-4o)
- ChatGPT curates playlists based on:
- Genres, styles, decades
- Popularity scores and play counts
- Your preferred strategy (genre/decade/artist/custom)
- Musical coherence and diversity
- ChatGPT creates playlists directly on Spotify using function calling
- 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
Data is cached in ~/.cache/discogs-sync/ to speed up runs and respect API limits.
To clear: rm -rf ~/.cache/discogs-sync/
not_found.json- Albums that couldn't be matched on Spotify
- Python 3.12+
- Discogs API credentials
- Spotify API credentials
- OpenAI API key (for ChatGPT-whatever-works-best--to-be-tested)
python -m src.cli sync [OPTIONS]python -m src.cli clear-cache