| name | dj-library-analyst |
| description | Analyze your rekordbox DJ library — BPM, key, genre stats and key-compatible setlist builder. Works with any rekordbox XML export. Zero dependencies. |
| tags | ["rekordbox","dj","camelot","key-compatibility","setlist","bpm","music-library"] |
| triggers | ["dj library","rekordbox","bpm of my collection","what key is this track","how many tracks","analyze my dj library","BPM range","energy levels","build a set","key compatible setlist"] |
DJ Library Analyst
Analyze your rekordbox DJ library and build key-compatible setlists from any rekordbox XML export. No accounts, no APIs, no dependencies — just Python and your exported library.
Setup
-
Export your rekordbox library as XML:
rekordbox → File → Export Library → "Export XML"
Save it as ~/rekordbox_export.xml (or any path you prefer).
-
That's it. No pip install, no API keys, no dependencies.
python3 analyze.py "full library stats"
python3 setlist.py 8A --genre techno --tops
Scripts
analyze.py — Library Statistics
python3 analyze.py [query] [--xml PATH]
Query examples:
| Query | What it does |
|---|
full library stats | Overview: track count, BPM range, keys, genres, artists |
how many tracks | Total tracks, tracks with BPM, samples/silent |
BPM distribution | Histogram + quartile stats |
key distribution | Camelot key breakdown, minor vs major ratio |
genre breakdown | Top 20 genres with counts |
tracks between 130 and 140 BPM | Filtered track list |
all tracks by Kosh | Artist search |
8A tracks | Key filter |
techno tracks between 135-142 BPM | Combined genre + BPM filter |
BPM arc from 120 to 140 | Energy arc: best track every 4 BPM |
setlist.py — Key-Compatible Setlist Builder
python3 setlist.py [starting_key] [options]
Examples:
python3 setlist.py
python3 setlist.py 8A
python3 setlist.py 8A --bpm 130 150 --genre techno
python3 setlist.py 8A --tops
python3 setlist.py --suggest-openers
python3 setlist.py --starting-bpm 135 --max 30
Options:
| Flag | Description |
|---|
starting_key | Camelot key to anchor the set (e.g. 8A) |
--bpm LO HI | BPM range filter |
--genre NAME | Genre substring filter |
--tops | Prefer most-played, highest-rated tracks |
--random | Random shuffle within BPM constraints |
--max N | Max tracks in set (default: 50) |
--dist N | Max Camelot step jump per transition (default: 2) |
--starting-bpm N | Open at specific BPM instead of key |
--suggest-openers | Show opener candidates (untouched tracks at ~130 BPM) |
--xml PATH | Custom XML path |
Camelot Key Compatibility
The setlist builder uses the Camelot harmonic mixing system:
- Same key = always compatible (
8A → 8A)
- ±1 step = compatible (
8A → 7A or 9A)
- Octave jump = compatible (
8A → 8B, minor↔major in same number)
--dist N controls max step distance per transition
Minor keys end in A, Major keys end in B. Tracks in the same number but different letter (e.g. 8A and 8B) share the same root note and mix well.
rekordbox XML Fields
The analyzer reads these fields from your XML export:
| Field | Description |
|---|
AverageBpm | Tempo in BPM |
Tonality | Musical key (Camelot: e.g. 8A, 11B) |
Genre | Genre tag |
Artist | Artist name |
Name | Track title |
Album | Album name |
Year | Release year |
TotalTime | Duration in seconds |
PlayCount | Times played |
Rating | 0–255 (rekordbox internal scale) |
Label | Record label |
Comments | User comments |
Extending
Both scripts are plain Python with zero dependencies. To adapt them:
- Different XML format: Modify
load_tracks() in each script to map your fields
- Export to JSON/CSV: Add a formatter after
load_tracks()
- Integrate with DJ software: Both scripts are read-only; wrap them in a tool that pipes output to your DJ app's scripting interface