Skip to content

Library toolkit

The library toolkit is the set of Python scripts in the scripts/ folder of the server repository. It performs library ingest - scan, tagging, lyrics, genres - and writes the same data.db SQLite file the server reads. This page is the map of what each script is; the behavioral walkthrough is the Tag and enrich your library guide.

The toolkit needs Python 3.12 or newer. Install its dependencies once, from the repository root:

Terminal window
python3 -m pip install -r scripts/requirements.txt

Then run every script from the root of the server repository: unlike the server binary, the toolkit does not search parent folders - it needs config.toml right there. Which keys it reads is in Server configuration.

Script What the audited source confirms
scan_library.py Scans your music folder into data.db. Takes --mode db, --mode quick and --mode reviewaq; the source names these modes but does not document their differences.
tagger.py Enriches file metadata using MusicBrainz and Cover Art Archive over HTTPS, with no credentials. Reads the [tagger] musicbrainz_root option.
tagger_ai.py AI-assisted tagging via Discogs. Needs discogs_consumer_key and discogs_consumer_secret under [auth] in config.toml.
genres.py Genre help: maps genres onto a controlled dictionary (the dict/ folder: audioland_dict.json and its base/) and queries Discogs, using the same [auth] keys.
genre_scraper.py Listed by the audit among the scripts that call MusicBrainz and Cover Art Archive over HTTPS without credentials - genre-dictionary support. Its detailed behavior is not documented.
lyrics.py Fetches lyrics for tracks - see the caution below.
user_tools.py User management, including creating your first account (the path used in Create your account).
db_tools.py A database helper. The source lists it without documenting detailed behavior.
albums_tools.py An album-side helper. The audit cites it as one of the scripts that require config.toml at the repository root; its behavior beyond that is not documented.
autopipeline.py Orchestrates the enrichment pass: runs tagger.py, lyrics.py and lyrics_tools.py.
run_tests.py Runs the toolkit’s own tests.

You may notice a scanner in the server’s own Rust code (backend/src/library/scanner.rs, with metadata reads via ffprobe in metadata.rs). The audit found no call site for it in the server runtime: in the audited build, library ingest runs through this Python toolkit, which writes the SQLite file directly. No document states which implementation is authoritative, so these docs treat the toolkit as the supported path.

Start with Troubleshooting: scans that find nothing, enrichment results that never show up and missing ffmpeg are covered there with their documented causes.