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 CodeRabbit reviews 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 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.1.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.1-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coverart_cli-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 4850922a4c59224b41294cc89517739a2f666d84f8ea01a89c16e936998d7c0a
MD5 5346b16494ae1ce4b688d47e85c43e21
BLAKE2b-256 d86bb19bc27ec46140b3e23baeb97ff9e6ef6eaa44b376f3bd4e403944e4fcb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for coverart_cli-0.4.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: coverart_cli-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 30.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6ef2043bc778240508d1c3fecf8b47a389dfdec43bb08dc9e126c445f5a9714
MD5 bf45772c6b029798a92c0d243f47de9c
BLAKE2b-256 06ce4f4b6e1a2eedb4f95201f03b7d7930c460d37c8bfac55ccda7100b0db481

See more details on using hashes here.

Provenance

The following attestation bundles were made for coverart_cli-0.4.1-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