Skip to main content

mp3-cover-adder

Add Cover to MP3 — free browser tool for embedding album art and editing ID3 tags (the reference UI for this library).

Offline Python library for embedding album art and editing ID3 metadata in MP3 files.

Package: mp3-cover-adder on PyPI (0.1.0).

Install

pip install mp3-cover-adder

Quick start

from mp3_cover_adder import MP3CoverAdder

# Read and modify an MP3 file
mp3 = MP3CoverAdder("song.mp3")
mp3.set_cover("cover.jpg")
mp3.set_metadata(title="My Song", artist="Artist Name", album="Album Title")
mp3.write("output.mp3")

# Or work with bytes in memory
result_bytes = mp3.to_bytes()

API

Class API

Method Description
MP3CoverAdder(file_path) Load MP3 from path, bytes, or BytesIO
.get_metadata() Returns dict with title, artist, album
.get_cover() Returns cover image as bytes or None
.set_cover(image, mime_type=None) Set/replace cover from path or bytes (JPEG/PNG)
.remove_cover() Remove all album art
.set_metadata(title=None, artist=None, album=None) Update ID3 text fields
.write(output_path=None) Save to file (or modify in-place if path is None)
.to_bytes() Get modified MP3 as bytes without writing

Convenience functions

Function Role
read_mp3_metadata(file) Read metadata + check for cover art
set_mp3_cover(input, image, output=None) Add cover (returns bytes if output is None)
remove_mp3_cover(input, output=None) Remove cover (returns bytes if output is None)
set_mp3_metadata(input, output=None, ...) Update metadata (returns bytes if output is None)
write_mp3(input, output, image=None, ...) One-shot: write MP3 with optional cover + metadata

Examples

Read metadata and cover

from mp3_cover_adder import read_mp3_metadata, MP3CoverAdder

# Quick check
info = read_mp3_metadata("song.mp3")
print(info)  # {'title': '...', 'artist': '...', 'album': '...', 'has_cover': True}

# Extract cover
mp3 = MP3CoverAdder("song.mp3")
cover_bytes = mp3.get_cover()
if cover_bytes:
    with open("extracted_cover.jpg", "wb") as f:
        f.write(cover_bytes)

Add or replace cover art

from mp3_cover_adder import set_mp3_cover

# From file path (MIME type auto-detected from extension)
set_mp3_cover("input.mp3", "cover.jpg", output_path="output.mp3")

# From bytes in memory (MIME type auto-detected from magic bytes)
with open("cover.png", "rb") as f:
    cover_data = f.read()

result = set_mp3_cover("input.mp3", cover_data)  # returns bytes
with open("output.mp3", "wb") as f:
    f.write(result)

Update metadata only

from mp3_cover_adder import MP3CoverAdder

mp3 = MP3CoverAdder("song.mp3")
mp3.set_metadata(
    title="Updated Title",
    artist="New Artist",
    album="New Album"
)
mp3.write()  # modify in-place

Remove album art

from mp3_cover_adder import remove_mp3_cover

remove_mp3_cover("input.mp3", output_path="output_no_cover.mp3")

All-in-one convenience

from mp3_cover_adder import write_mp3

write_mp3(
    input_path="input.mp3",
    output_path="output.mp3",
    image_source="cover.jpg",
    title="Song Title",
    artist="Artist Name",
    album="Album Name"
)

Tests

pytest
# or with coverage
pytest --cov=mp3_cover_adder

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src/ tests/

# Lint
ruff check src/ tests/

License

MIT. See LICENSE.

Metadata

Release files for mp3-cover-adder 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mp3-cover-adder 0.1.0
File Size Uploaded Provenance Actions
mp3_cover_adder-0.1.0.tar.gz 9.5 kB Without provenance Details for mp3_cover_adder-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mp3-cover-adder 0.1.0
File Interpreter ABI Platform Actions
mp3_cover_adder-0.1.0-py3-none-any.whl Python 3 none any Details for mp3_cover_adder-0.1.0-py3-none-any.whl

Total release size: 15.8 kB

Release files / mp3_cover_adder-0.1.0.tar.gz

Download URL mp3_cover_adder-0.1.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c2f63a5fee75659ef21ae006b7bdf6975a2471dda1118bab6fc63fd7356a9422
BLAKE2b-256 checksum
How to use checksums
e03266a0da7fdac1f8a0a1d9febaa5b729c48dc12d1e3250dea980ec2dfa2a78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mp3_cover_adder-0.1.0-py3-none-any.whl

Download URL mp3_cover_adder-0.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b96d0a1d293d4f3269a14236e265d0599d1d0a240d76bd09a0a1710318cc569
BLAKE2b-256 checksum
How to use checksums
fa661d32b31fbb55916f0a6b4c9178eecd60b150d130912dd6ed21920e9c18e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mp3-cover-adder 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page