discogs2rb is a command-line utility designed for DJs who use Rekordbox and want to enhance their music library with accurate album and artist metadata from Discogs. The script connects to the encrypted Rekordbox SQLite database, identifies tracks missing album or album artist information, and attempts to enrich the metadata using the Discogs API.
✅ This tool is built with Poetry for dependency management and includes development tools like
black,ruff, andmypy.
- Connects to the encrypted Rekordbox database using
pysqlcipher3 - Queries tracks missing album or album artist metadata
- Uses the Discogs API to resolve metadata
- Automatically handles API rate limits (60 requests per minute)
- Writes enriched metadata to a
output.csvfile - Supports verbose/debug logging
When finished, all resolved tracks will be written to a file named output.csv in the project root. The file includes the following columns:
TrackID, TrackTitle, TrackArtist, AlbumTitle, AlbumArtists, ReleaseYear, ReleaseDate, ReleaseURL, Artwork
git clone https://github.com/deviationist/discogs2rb.git
cd discogs2rbCopy the .env.example file and fill in the required values:
cp .env.example .envEdit .env with your preferred text editor:
REKORDBOX_MASTERDB_PATH– full path to your Rekordbox SQLite DBREKORDBOX_MASTERDB_PASSWORD– the password for decrypting the SQLite DBDISCOGS_TOKEN– your Discogs API token (follow this guide to get token)VARIOUS_ARTIST_NAME– the name used to represent various artist releasesINCLUDE_NO_HITS=true|false– (optional) whether to write tracks with no hits (in Discogs) to the output CSVINCLUDE_MULTIPLE_HITS=true|false– (optional) whether to allow for multiple hits (in Discogs) for the same track to be written to the output CSVFOLDER_PATHS_TO_IGNORE- (optional) whether to ignore certain folder paths from the Rekordbox query, comma separated paths
🔐 Note: Your Rekordbox database must be decrypted using your master password.
To use the Discogs API, you'll need a personal access token. Here's how to get one:
- Go to https://www.discogs.com and log into your account.
- Click your avatar in the top-right corner and select Settings.
- In the sidebar, click Developers.
- Scroll to the section "Just need a personal access token?" and click Generate token.
- Copy the token and paste it into your
.envfile underDISCOGS_TOKEN.
Make sure Poetry is installed.
poetry installTo run the metadata resolution script:
poetry run discogs2rb-vor-vv: Enable verbose or debug logging
Example:
poetry run discogs2rb -vvThis project uses the following tools for code quality:
To run formatters and linters:
poetry run black .
poetry run ruff check .
poetry run mypy .- Discogs enforces a strict API rate limit (60 requests per minute). The script will automatically wait when needed to avoid hitting this limit.
- The script may take some time to complete if many tracks need to be resolved.
MIT License
Project URL: https://github.com/deviationist/discogs2rb