Skip to main content

Sync rekordbox playlists to Plexamp/Plex

Project description

rekordbox-plexamp-sync

Available at https://pypi.org/project/rekordbox-plexamp-sync/0.1.0/

Sync rekordbox playlists to Plexamp/Plex - available as both a Python package and CLI tool.

Features

  • 🎵 Sync all rekordbox playlists to Plex/Plexamp
  • 🚀 Fast track matching using pre-built maps
  • 📦 Available as a Python package for integration into other apps
  • 💻 Command-line interface for manual syncing
  • 🔄 Smart playlist detection and skipping
  • 📊 Detailed sync reports with track-level information

How it works

This tool extracts all playlists from the rekordbox database, then interacts with the Plex Media Server API to create or update playlists.

Note: This will only work if your rekordbox library is indexed by Plex. Make sure you deactivate all content matchers for Albums so that Plex does not match and rename tracks. This messes with the track matching to rekordbox - the titles need to be identical for better results.

Installation

As a Package (for integration into other apps)

# Install from local build
pip install dist/rekordbox_plexamp_sync-0.1.0-py3-none-any.whl

# Or install in development mode
pip install -e .

# Or from PyPI (after publishing)
pip install rekordbox-plexamp-sync

For CLI Usage

# Clone the repository
git clone <your-repo-url>
cd rekordbox-plexamp-sync

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install the package
pip install -e .

# Build the Go shared library
make

Usage

As a CLI Tool

# Basic usage
rekordbox-plexamp-sync http://localhost:32400 your-plex-token

# With verbose output
rekordbox-plexamp-sync http://localhost:32400 your-plex-token --verbose

# Get help
rekordbox-plexamp-sync --help

Legacy CLI (still works):

python app.py http://localhost:32400 your-plex-token --verbose

As a Python Package

from plexapi.server import PlexServer
from rekordbox_plexamp_sync import (
    Logger,
    build_plex_track_map,
    build_plex_playlist_map,
    get_playlists,
)
from rekordbox_plexamp_sync.core import sync_playlists

# Initialize
logger = Logger(verbose=False)
plex = PlexServer('http://localhost:32400', 'your-token')

# Get rekordbox playlists
rekordbox_playlists = get_playlists()

# Build maps (cache these for performance)
track_map = build_plex_track_map(plex, logger)
playlist_map = build_plex_playlist_map(plex, logger)

# Sync
result = sync_playlists(
    plex=plex,
    rekordbox_playlists=rekordbox_playlists,
    track_map=track_map,
    playlist_map=playlist_map,
    logger=logger,
)

# Check results
print(f"Created: {len(result['created_playlists'])}")
print(f"Updated: {len(result['updated_playlists'])}")

In a macOS Menu Bar App

See examples/menubar_app_example.py for complete examples using rumps, pystray, and other frameworks.

import rumps
from rekordbox_plexamp_sync import sync_rekordbox_to_plex

class RekordboxSyncApp(rumps.App):
    @rumps.clicked("Sync Now")
    def sync_now(self, _):
        result = sync_rekordbox_to_plex(
            server_url="http://localhost:32400",
            token="your-token",
            verbose=False
        )
        rumps.notification(
            title="Sync Complete",
            message=f"Created: {len(result['created_playlists'])}"
        )

RekordboxSyncApp("Rekordbox Sync").run()

Usage (windows)

I don't have a windows machine to try this on, but build the shared library with Golang.

Edit main.go and change the rekordbox pathes. Check the go-rekordbox README about where to find these pathes:

	optionsFilePath := filepath.Join(homeDir, "/Library/Application Support/Pioneer/rekordboxAgent/storage/", "options.json")

	// Files and paths
	asarPath := "/Applications/rekordbox 6/rekordbox.app/Contents/MacOS/rekordboxAgent.app/Contents/Resources/app.asar"

Then build the shared lib and generate a dll

go build -buildmode=c-shared -o library.dll main.go

Update app.py get_playlists() to load the new dll instead:

library = ctypes.cdll.LoadLibrary('./library.dll')

Then, follow steps from "Usage (mac)"

Limitations and todos

  • Intelligent Playlists aren't supported yet, this needs some extra work
  • Matching happens against filename and then title as backup, this can still be improved

Getting Your Plex Token

  1. Open Plex Web App in your browser
  2. Open browser developer tools (F12)
  3. Go to Application/Storage → Local Storage
  4. Look for myPlexAccessToken

Alternatively, you can find it by following Plex's official guide.

Building the Package

# Install build tools
pip install build twine

# Build the Go shared library
make

# Build the Python package
python -m build

# Output will be in dist/:
# - rekordbox_plexamp_sync-0.1.0-py3-none-any.whl (installable package)
# - rekordbox_plexamp_sync-0.1.0.tar.gz (source distribution)

For detailed packaging instructions, see PACKAGING.md.

Documentation

Requirements

  • Python 3.8+
  • macOS (for the Go shared library)
  • Plex Media Server with music library
  • rekordbox 6

Limitations and TODOs

  • Smart/Intelligent Playlists aren't supported yet (requires extra work)
  • Matching happens against filename first, then title as backup (can be improved)
  • Currently macOS only (Windows support needs testing and binary compilation)

Acknowledgements

This tool is powered by:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rekordbox_plexamp_sync-0.1.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rekordbox_plexamp_sync-0.1.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file rekordbox_plexamp_sync-0.1.1.tar.gz.

File metadata

  • Download URL: rekordbox_plexamp_sync-0.1.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.2

File hashes

Hashes for rekordbox_plexamp_sync-0.1.1.tar.gz
Algorithm Hash digest
SHA256 094d3d1c894a16e44184da96072b7c31b1600dd430a903368b967b708d94e389
MD5 35e7e364f8a57d48919125918fcd1e98
BLAKE2b-256 42579f3ef5584b6469470eb57d6b244d6d7ed7cbe8bc439dba29beb06a9b31af

See more details on using hashes here.

File details

Details for the file rekordbox_plexamp_sync-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rekordbox_plexamp_sync-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16ed92827f5502e4d4a8a6ef4e27773113c4ab2d66b013bce23b5f02b4c3c00b
MD5 49609166d8658f89d4cf5d4d89b34d13
BLAKE2b-256 5dc6254a9fb8fa621b4bba8ca1a353f5ea0265c801090c619324d420bdd6a3ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page