Skip to main content

Automatically fetch and safely complete music metadata, cover art, and synced lyrics from the CLI.

Project description

meta-sonata

Tests PyPI Python 3.9+ MIT License

English | 简体中文

Automatically fetch and fill missing music metadata, cover art, and synced lyrics for your music folders. Preview the changes, then apply them with one command.

Two Commands

Query and preview the metadata meta-sonata finds. Nothing is written:

meta-sonata enrich "/music/album"

Fetch and write metadata, cover art, and lyrics in one step:

meta-sonata enrich "/music/album" --write

Both commands accept an album folder or a larger music directory. Existing tags, filenames, and folder structure are trusted first; online sources fill the gaps.

meta-sonata CLI preview and write workflow

Why meta-sonata?

  • Local first: existing tags, folder names, and track structure anchor the match.
  • Conservative: track count, duration, live/studio, and ambiguity checks prevent risky writes.
  • Complete: metadata, cover art, and synced lyrics in one command.
  • Automation-ready: dry runs, external incremental state, recursive discovery, and JSON audit plans.

Quick Start

pipx install meta-sonata

Or install it with uv:

uv tool install meta-sonata

Typical output:

scan: root=/music/album files=12 album_groups=1 loose_tracks=0 max_depth=3
resolve: 1/1 /music/album
lyrics: 1/1 /music/album
dry run: 1 plan(s)
- album: Artist / Album: artist=Artist  album=Album  year=2006  tracks=12  confidence=0.96  lyrics=11/12
nothing written; pass --write to apply

enrich enables metadata lookup, cover lookup, and lyrics by default. It scans up to three directory levels; use --max-depth N or --recursive when needed.

What It Can Fill

Area Fields
Identity title, artist, album artist, album, track/disc number
Release date, label, catalog number, barcode, release type
Sources MusicBrainz release/track IDs and provenance tags
Media embedded cover art, synced LRC, plain lyrics

Album metadata sources: MusicBrainz, iTunes, and NetEase.

Lyric sources: QQ Music, NetEase, KuGou, KuWo, and Migu.

meta-sonata sources

Put It in a Pipeline

Run it after download/extraction/CUE splitting and before the final library sync:

meta-sonata enrich "/staging/new-music" \
  --changed-only \
  --state-dir "/var/lib/meta-sonata" \
  --write

Incremental state stays outside music folders. No marker files are added to albums.

Optional Metadata Browser

meta-sonata web "/music" --host 127.0.0.1 --port 8765

Open http://127.0.0.1:8765/ to browse audio files, core tags, source IDs, technical details, covers, and embedded lyrics. The web UI has no write endpoints.

meta-sonata read-only metadata browser

Shown with generated silent FLAC demo files and public-domain work metadata.

Safety

  • Every write command is a dry run unless --write is present.
  • Low-confidence lyrics and ambiguous release identities are skipped.
  • Mixed loose tracks are not forced into a fake album.
  • Real libraries can be protected with META_SONATA_PROTECTED_PATHS.
  • Tests generate silent FLAC files; no copyrighted media is committed.

More

Python 3.9+ is supported. The project is currently an early 0.1.x release; unofficial provider endpoints may change or be rate-limited.

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

meta_sonata-0.1.2.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

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

meta_sonata-0.1.2-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

Details for the file meta_sonata-0.1.2.tar.gz.

File metadata

  • Download URL: meta_sonata-0.1.2.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for meta_sonata-0.1.2.tar.gz
Algorithm Hash digest
SHA256 74453ae2504445c87f1d438b6ecd2bbf3b51fb4d68647984e6b4bf9a266e2a8b
MD5 6e95282b55f916567e0c04a0b6279f4e
BLAKE2b-256 fe81c921b940c56954bacfd8ab385cef7b427733ff8b39045e2ad7fb92b4ce6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for meta_sonata-0.1.2.tar.gz:

Publisher: publish.yml on sendingE/meta-sonata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meta_sonata-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: meta_sonata-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 50.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for meta_sonata-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a25990a393031bfd881e04e1c0496ca695c1df6f9a8ab78f90ca6c3fbac73c2d
MD5 474012cc3ab94bbf84097d6c3fb46671
BLAKE2b-256 bdc8c902da247ad65cae5a95733b20770fde416fd0d4bf8cb04a279ef28e877d

See more details on using hashes here.

Provenance

The following attestation bundles were made for meta_sonata-0.1.2-py3-none-any.whl:

Publisher: publish.yml on sendingE/meta-sonata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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