Skip to main content

Fetch missing album covers from Last.fm, iTunes, Deezer, MusicBrainz; embed in MP3/M4A/FLAC/Ogg and write a cover.jpg sidecar

Project description

coverart-cli

Fill the missing covers in your music library — embed and sidecar in one pass.

HTML coverage report

CI CodeQL PyPI PyPI downloads Python License: MIT

What it does

Most cover-art tools only embed or only sidecar. That breaks across players — Subsonic apps (Amperfy, Symfonium) read tags, Plex / Jellyfin prefer cover.jpg, Apple Music wants embedded. coverart-cli does both in one pass and ships an HTML coverage report so you can see what's still missing.

Install

pipx install git+https://github.com/WildDragonKing/coverart-cli

Use

# Fetch + embed + sidecar (free providers — no key needed)
coverart ~/Music

# Add Last.fm too (much higher hit rate)
LASTFM_API_KEY=xxx coverart ~/Music

# Just generate the coverage report
coverart ~/Music --report-only --report-html report.html

# See what would happen, change nothing
coverart ~/Music --dry-run -v

Run coverart --help for the full flag list.

Config file

Save your defaults so you don't have to repeat flags:

# ~/.config/coverart-cli/config.toml
lastfm_key      = "your-key"
min_bytes       = 30000
replace_smaller = true
no_musicbrainz  = false

Lookup order (later wins): built-in → ~/.config/coverart-cli/config.toml./coverart.toml--config PATH → CLI flags → environment variables. Run coverart ~/Music afterwards with no flags.

Sources

Tried in order until a cover is found:

  1. Last.fmalbum.getinfo (needs a free API key)
  2. iTunes — Apple Music's public search, no key
  3. Deezer — public API, no key
  4. MusicBrainz + Cover Art Archive — fallback for niche releases

Supported formats

MP3 (ID3 APIC), M4A/M4B/MP4 (covr atom), FLAC (Picture block), Ogg Vorbis / Opus (metadata_block_picture).

Programmatic use

from pathlib import Path
from coverart_cli.core import RunOptions, run
from coverart_cli.providers import ITunesProvider, DeezerProvider

stats = run(RunOptions(
    root=Path("~/Music").expanduser(),
    providers=[ITunesProvider(), DeezerProvider()],
))
print(stats.fetched_from, stats.not_found)

Alternatives

Tool When to pick it
sacad Best match rate; Rust binary, more sources
get-cover-art Battle-tested Python API
beets fetchart Already using beets for everything else
coverart-cli (this) You want the HTML report + embed/sidecar dual-output in ~700 LOC

Development

git clone https://github.com/WildDragonKing/coverart-cli && cd coverart-cli
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest && ruff check .

Releases

Releases are fully automated via release-please. Commits to main follow Conventional Commits:

Commit prefix Effect on next release
feat: … minor bump (0.3.0 → 0.4.0)
fix: … patch bump (0.3.0 → 0.3.1)
feat!: … / BREAKING CHANGE: major bump (0.3.0 → 1.0.0)
docs:, refactor:, perf: changelog entry, no bump
chore:, ci:, test: hidden in changelog

release-please opens a single rolling "Release PR" that accumulates the pending version. Merging that PR creates the git tag, which triggers the PyPI publish workflow.

License

MIT

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

coverart_cli-0.4.0.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

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

coverart_cli-0.4.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file coverart_cli-0.4.0.tar.gz.

File metadata

  • Download URL: coverart_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for coverart_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 dea34ccc04a7d95b525a8ec1857538bdffb58f1606dad6e472bec7369564c0cb
MD5 c253b70f9755e2a3e64071ae9f839e36
BLAKE2b-256 a6a2d50eb0c0895dad4d9f83a059432361d66daa0f4b5daedea197951e12e48f

See more details on using hashes here.

Provenance

The following attestation bundles were made for coverart_cli-0.4.0.tar.gz:

Publisher: release.yml on WildDragonKing/coverart-cli

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

File details

Details for the file coverart_cli-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: coverart_cli-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for coverart_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02e57914090ee53613c4a1f29d3ce7c6f2db42e92053b6a98cc5b51bc94baa65
MD5 bea00151d5588c6eb183f79de797c51e
BLAKE2b-256 fe6223f243bff43299c0c5969a3712a19d79ccf9c33f1f11a18c2ae4a9ad1b22

See more details on using hashes here.

Provenance

The following attestation bundles were made for coverart_cli-0.4.0-py3-none-any.whl:

Publisher: release.yml on WildDragonKing/coverart-cli

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