Friendly command-line music-metadata editor and Python library
Project description
mudio
mudio is a powerful, friendly command-line music metadata editor and Python library. It provides a unified API for handling metadata across MP3, FLAC, M4A, and more, making batch processing and automation simple and safe.
Features
- Unified API: Write code once, run it on MP3, FLAC, M4A, WAV, OGG, OPUS, WMA, and WavPack.
- Batch Processing: robust CLI for processing thousands of files.
- Parallel Execution: Automatically uses multi-threading for large batches.
- Safety First: Built-in backup system, dry-run mode, and careful validation.
- Powerful Operations:
- Find & Replace: Regex-supported search and replace in tags.
- Mass Edits: Set, overwrite, append, prefix, or clear tags.
- Filtering: Apply changes only to files matching specific criteria (e.g.
artist="The Beatles").
Supported Formats
- MP3 (
.mp3) - ID3v2.3/v2.4 - FLAC (
.flac) - Vorbis Comments - M4A / MP4 (
.m4a,.mp4) - MP4 Tags - Ogg Vorbis (
.ogg) - Opus (
.opus) - WAV (
.wav) - Windows Media Audio (
.wma) - WavPack (
.wv)
Installation
pip install mudio
CLI Usage
mudio is designed for efficient batch operations.
Basic Commands
# View metadata
mudio song.mp3 --mode view
# Set Album and Date
mudio *.mp3 --mode set --album "New Album" --date "2024"
# View metadata (truncated if long)
mudio song.mp3 --mode print
# Overwrite Title
mudio song.flac --mode overwrite --fields title --value "My Song"
Advanced Batch Operations
# Regex Find & Replace (Fix features)
# Changes "feat." -> "ft." in title and artist
mudio /music --recursive \
--mode find-replace --find "feat\." --replace "ft." --regex \
--fields title,artist
For full command details, see the [CLI Reference](docs/cli_reference.md).
For code API details, see the [API Reference](docs/api_reference.md).
# Append to Comment
mudio *.m4a --mode append --fields comment --value " [Remastered]"
# Filtered Processing
# Only add "Rock" genre to tracks by "Led Zeppelin"
mudio /library --recursive \
--filter "artist=Led Zeppelin" \
--mode overwrite --fields genre --value "Rock"
Safety Features
# Dry Run (See what would happen without modifying files)
mudio *.mp3 --mode set --album "Test" --dry-run
# Create Backups (Saved to ./backups/)
mudio *.flac --mode clear --fields comment --backup ./backups
Python Library Usage
mudio provides a Pythonic wrapper around mutagen for scripts and tools.
from mudio import SimpleMusic
# Reading
with SimpleMusic("song.flac") as sm:
print(sm.read_fields())
# {'artist': ['The Band'], 'title': ['The Song'], ...}
# Writing
with SimpleMusic("song.mp3") as sm:
sm.write_fields({
'title': ['New Title'],
'genre': ['Pop', 'Rock'] # Multi-value support
})
# Error handling is managed by the context manager
Comparison with Alternatives
vs. Mutagen
- Mutagen is the low-level library that
mudiouses. It is powerful but requires learning different APIs for ID3, Vorbis, and MP4 tags. - mudio abstracts these differences. Use
mudioif you want a simple, unified API (e.g.sm.write_fields({'title': ...})works on everything). Usemutagenif you need byte-level control or support for obscure frame types.
vs. Beets
- Beets is a complete library manager with a centralized database, autotagger, and plugin system. It implies a workflow where it "owns" your library.
- mudio is a stateless tool. It modifies files directly without a database. Use
mudiofor quick fixes, batch scripting, or if you prefer managing your file structure manually.
vs. Picard
- MusicBrainz Picard is a GUI application focused on matching files to the MusicBrainz database.
- mudio is a CLI/Library tool. It's better for automation, headless servers, or mass-editing tags based on patterns rather than database matching.
vs. music_tag
- music_tag is a library primarily for Python scripts, offering a dictionary-like interface. It is excellent for simple script usage.
- mudio offers similar library features but includes a robust CLI for batch processing, filtering, and safety operations (backups, dry-runs) out of the box.
vs. EyeD3
- EyeD3 is excellent but specific to MP3/ID3.
- mudio supports FLAC, M4A, OGG, and more with the same commands.
Development
# Install dependencies
pip install -e ".[dev]"
# Run tests
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mudio-1.0.0.tar.gz.
File metadata
- Download URL: mudio-1.0.0.tar.gz
- Upload date:
- Size: 39.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7abb1e085e8293de94c94388c6487065a8e0efa914ce2932e77026b8fc36dc14
|
|
| MD5 |
0e01b13ab1b61de0fdcbfe866b5e990e
|
|
| BLAKE2b-256 |
21d3df2e032bef4d0be83e17f548d3e4084eda9f86fd5b0ea51076d75aee61a8
|
File details
Details for the file mudio-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mudio-1.0.0-py3-none-any.whl
- Upload date:
- Size: 37.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a4d77c304eb073f93d9715df37941f9e591b9904c7f1957d4a18d8e9ee33698
|
|
| MD5 |
f46917064c3052be9a849debe3f5d0cd
|
|
| BLAKE2b-256 |
b400c2210f872ed61e42280336ce7e1a803f98f3ce5fff3a01a0f429ecc91631
|