A collection of tools for managing your music library
Project description
Lib-Sync
libsync has some useful tools for managing your music library.
syncsyncs your rekordbox playlists to spotify playlists.analyzeanalyzes your rekordbox library.ididentifies songs from a recording or youtube set.
User Guide
Prerequisites
- python 3.11 installed locally
.envfile in the root directory with client ID and secret- go to the Spotify developers dashboard and go to Create App to get a client ID and secret
- copy
.example.envfrom this directory into a new file.envin the same directory and add youridandsecret
ffmpeginstalled and available on the path
Setup
In this directory, run:
python3.11 -m venv .venv # create virtual environment
source .venv/bin/activate # activate virtual environment
pip install -e ".[dev]" # install dependencies locally
Sync
From the rekordbox application, export your library as xml (remember where you save the file). Then run:
python -m libsync sync -h # display help page
python -m libsync sync \
--rekordbox_xml_path ${HOME}/Documents/rekordbox/rekordbox_export.xml \
--create_collection_playlist
Manually Fixing the Mappings
After running the sync command at least once for your library, you can update the spotify URL (input) column in the data/*.csv file generated by libsync. Just paste in the track's spotify URL in the Spotify URL (input) column. Then next time you sync, libsync will pick up those new mappings and update your playlists. You can also manually update the Spotify URI column with libsync:NOT_ON_SPOTIFY for songs you know are not on Spotify, so libsync knows to stop looking for it.
If you want libsync to redo the auto mapping process for a previously analyzed song, you can tag it with a 1 in the Retry auto match (input) column in the csv. This can be useful if a song is newly posted on Spotify, or to take advantage of libsync improvements. This will override the libsync:NOT_ON_SPOTIFY flag. Use this with the --ignore_spotify_search_cache command line flag to hit the network again instead of just using the cache and running the matching algorithm again.
Analyze
python -m libsync analyze -h
Dev Guide
Quickstart
One time setup
python -m venv .venv # create virtual environment
Each time you pull a new version
source .venv/bin/activate # activate virtual environment
pip install -e ".[dev]" # install dependencies locally
pre-commit install # install pre-commit hooks
To add useful dev shell commands
Add the following to your .bashrc or .zshrc:
LIBSYNC_REPO_DIRECTORY='/Users/joshlebed/code/lib-sync' # update to the path to the repo on your machine
alias libsync-dev="${LIBSYNC_REPO_DIRECTORY}/.venv/bin/python -m libsync"
alias libsync-run-sync="cd ${LIBSYNC_REPO_DIRECTORY} && ${LIBSYNC_REPO_DIRECTORY}/scripts/run_sync.sh"
To run with sample data:
python -m libsync --verbose --verbose \
sync \
--rekordbox_xml_path sample_data/example_rekordbox_export.xml \
--create_collection_playlist
Use --verbose or -v before the subcommand to increase the verbosity of logging to the console.
Use one -v for INFO level, two for DEBUG level.
To run with prod data:
python -m libsync --verbose --verbose \
sync \
--rekordbox_xml_path ${HOME}/Documents/rekordbox/rekordbox_export.xml \
--create_collection_playlist
To run analysis command:
python -m libsync analyze \
--rekordbox_xml_path sample_data/example_rekordbox_export.xml \
python -m libsync analyze \
--rekordbox_xml_path ${HOME}/Documents/rekordbox/rekordbox_export.xml
To run id command:
python -m libsync id file \
--recording_audio_file_path sample_data/file.mp3 \
python -m libsync id youtube \
--youtube_url https://www.youtube.com/watch\?v\=6qSnO5U95yU \
Linting/Formatting
[TODO]
TODO
features
- support deleting tracks from rekordbox - libsync doesn't know it was deleted manually, so it will report that the song is missing from the rekordbox playlist. need to keep track of rekordbox collection history to track deletions
- support read-only playlists - like "to be tagged" - ignore these when syncing from spotify back to rekordbox
- multithread shazam process
- connect id tool to spotify mapper and playlist creator
dev
- get markdown autoformatter
- fix structure/imports with https://github.com/jgehrcke/python-cmdline-bootstrap
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lib_sync-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lib_sync-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e0f558b6a58b7a2c38f087f9880aa6aa504f7b62797db52c4f8b89755923a04
|
|
| MD5 |
d6e80283ddfc7cc33d65ac19d32973f4
|
|
| BLAKE2b-256 |
f41100fde4db7395f9ca2f49af56ad2d513b886ab02c02f6c6b6352da9734327
|