Lib-Sync
Lib-Sync is a collection of tools for managing your music library across different platforms.
Features
- Sync: Synchronize your Rekordbox playlists with Spotify playlists
- Analyze: Analyze your Rekordbox library for insights and statistics
- Identify: Identify songs from recordings or YouTube sets using audio fingerprinting
Installation from PyPI
Please make sure you have Python 3.11 or newer (python --version).
Install lib-sync
# with pipx (recommended)
pipx install lib-sync
# with pip
python -m pip install lib-sync
Upgrade lib-sync
# with pipx (recommended)
pipx upgrade lib-sync
# with pip
python -m pip install --upgrade lib-sync
After installation, the libsync command will be available in your terminal.
Troubleshooting: If libsync command is not found:
- Make sure you're using Python 3.11 or higher
- If your python is installed via rye (or in a virtual environment), try
python -m pip install --force-reinstall --user lib-sync - try running
python -m pip install --upgrade pip wheelfirst
Prerequisites
- Python 3.11 or higher
- For YouTube id extraction, you'll need ffmpeg installed and available on PATH
- For Spotify sync functionality, you'll need Spotify API credentials (see Spotify API Setup below)
Configuration
Spotify API Setup
- Go to the Spotify Developers Dashboard
- Click "Create App" to get a Client ID and Client Secret
- Create a
.envfile in your working directory:
cp .env.example .env
- Add your Spotify credentials to the
.envfile:
SPOTIPY_CLIENT_ID=your_client_id_here
SPOTIPY_CLIENT_SECRET=your_client_secret_here
Usage
Sync Rekordbox to Spotify
First, export your library from Rekordbox as XML (File → Export Collection in XML format).
# Display help
libsync sync -h
# Basic sync
libsync sync --rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml
# Sync with collection playlist creation
libsync sync \
--rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml \
--create_collection_playlist
# Sync specific playlists only
libsync sync \
--rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml \
--rekordbox_playlist_names "House Music" "Techno Classics"
# Force refresh Spotify search cache
libsync sync \
--rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml \
--ignore_spotify_search_cache
Analyze Rekordbox Library
# Display help
libsync analyze -h
# Analyze library
libsync analyze --rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml
# Generate detailed report
libsync analyze \
--rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml \
--output_format detailed
Identify Songs
# Identify from audio file
libsync id file --recording_audio_file_path ~/Music/unknown_track.mp3
# Identify from YouTube URL
libsync id youtube --youtube_url "https://www.youtube.com/watch?v=VIDEO_ID"
# Identify with timestamp range (for DJ sets)
libsync id youtube \
--youtube_url "https://www.youtube.com/watch?v=VIDEO_ID" \
--start_time "10:30" \
--end_time "15:45"
Debugging
Use -v or --verbose flags before the subcommand for more detailed output:
# INFO level logging
libsync -v sync --rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml
# DEBUG level logging
libsync -vv sync --rekordbox_xml_path ~/Documents/rekordbox/rekordbox_export.xml
Manual Track Matching
After running sync at least once, Lib-Sync creates a CSV file in the data/ directory with your track mappings. You can manually improve the matches:
- Open the generated CSV file (e.g.,
data/rekordbox_spotify_matches_YYYY-MM-DD.csv) - To manually match a track:
- Paste the Spotify track URL in the
Spotify URL (input)column - For tracks not on Spotify, enter
libsync:NOT_ON_SPOTIFYin theSpotify URIcolumn
- Paste the Spotify track URL in the
- To retry automatic matching:
- Put
1in theRetry auto match (input)column - Use with
--ignore_spotify_search_cacheto force a new search
- Put
The next sync will use your manual corrections.
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT License - see LICENSE file for details.
Metadata
Release files for lib-sync 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lib_sync-0.2.2.tar.gz | 31.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lib_sync-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.4 kB
Release files / lib_sync-0.2.2.tar.gz
| Download URL | lib_sync-0.2.2.tar.gz |
|---|---|
| Size | 31.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
678c0ae2d7a360be3549d7dfc5bf1369a5e9156a413e1e3607673069b4d5aa27
|
|
BLAKE2b-256 checksum How to use checksums |
4060931bcfbd2eca7e1f482330399c0427f1c4e1cfcab260034c7705f9bb95c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / lib_sync-0.2.2-py3-none-any.whl
| Download URL | lib_sync-0.2.2-py3-none-any.whl |
|---|---|
| Size | 39.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
997d3437cf385384d1e6610c10a14a13060b568311231f56885b821fb5d83919
|
|
BLAKE2b-256 checksum How to use checksums |
bc82a396066cef3acc5b3293538218f1696ea7c3b157263232ebd2694088e091
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|