Skip to content

Rekordbox reader with multi-strategy DB access + compatibility fixes #198

Description

@alevizio

Hi Dylan! I've been using pyrekordbox in DJUSB, a cross-platform DJ app that exports USB drives for Pioneer CDJ hardware. Thanks for building and maintaining this library!

During development I built a rekordbox_reader.py wrapper around pyrekordbox that handles several edge cases I encountered. Wanted to share these in case any of it is useful upstream:

Multi-Strategy Database Access

The reader implements a cascade of fallback strategies for reading Rekordbox 6 databases:

  1. Rekordbox6Database (pyrekordbox 0.4+ API) — preferred path
  2. Direct sqlcipher3 with the static BLOB key from pyrekordbox.db6.database — fallback when the high-level API has issues
  3. XML library fallback — reads rekordbox.xml export when database access fails entirely

This handles cases where users have different pyrekordbox versions installed, or where sqlcipher3 compilation fails on certain platforms.

Field Access Compatibility

Different pyrekordbox versions expose row fields differently. The reader has a safe_get() helper that handles:

  • Direct attribute access (pyrekordbox >= 0.3)
  • .value property access (older versions where fields are wrapped objects)
  • Graceful fallback to defaults for missing fields

Table Iteration

Similar compatibility layer for iterating table rows — iter_rows() tries multiple API styles:

  • Direct attribute iteration (newer pyrekordbox)
  • .get_content() / .get_tracks() methods (older API)

Cue Point Color Mapping

Maps Rekordbox's internal color IDs (from both RGB values and numeric IDs) to named colors compatible with Pioneer CDJ hot cue display.


Would any of these compatibility patterns be useful as PRs to pyrekordbox itself? Happy to contribute if so. The full reader is at the link above — it's ~2100 lines but the core compatibility logic is in the first ~100 lines.

Thanks for making pyrekordbox — it's a great library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions