mutagen
read and write audio tags for many formats
What it is and what it does
Mutagen is a Python library for reading and writing metadata tags in audio files. It abstracts the complexity of different audio formats—MP3, FLAC, Ogg Vorbis, MP4, WavPack, and many others—behind a unified interface, so you can edit ID3v2 and APEv2 tags without needing to understand each format's internal structure. It also supports lower-level operations like reading Xing headers for accurate MP3 bitrate calculation and manipulating Ogg streams at the packet level.
The library has no external dependencies beyond Python's standard library and requires Python 3.10+. It runs on CPython and PyPy across Linux, Windows, and macOS. With active maintenance, it is a mature, widely-used choice for audio metadata tasks in both standalone scripts and larger applications.
Use it for:
- Batch-update ID3 tags across an MP3 collection (artist, album, genre).
- Extract and organize metadata from FLAC or Ogg files for music library management.
- Build a music tagger or metadata editor GUI that supports multiple audio formats.
- Programmatically read MP3 bitrate and length from Xing headers for audio analysis.
- Migrate or standardize tags between different audio formats in a conversion pipeline.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Mutagen reads and writes audio metadata (tags) across many audio formats including MP3, FLAC, OGG, MP4, WavPack, and others, supporting ID3v2 and APEv2 tag editing.
Yes. Mutagen is a mature, actively maintained library with no external dependencies, low install friction, and broad format support. The GPL-2.0-or-later license is a clear constraint for proprietary use, but poses no barrier for open-source projects. Install it if you need to read or edit audio tags programmatically.
Install
mutagen on PyPI
pip
pip install mutagenuv
uv add mutagenpoetry
poetry add mutagenInstalling mutagen
Before you install
Low friction: pure Python wheel with no runtime dependencies outside the standard library. Active maintenance with a recent release 50 days ago.
License in practice
GPL-2.0-or-later (copyleft): any derivative work or distribution must be licensed under GPL v2 or later. Suitable for open-source projects; proprietary software must either avoid linking or obtain a commercial license.
Quickstart
pip install mutagen
from mutagen.id3 import ID3
tags = ID3('song.mp3')
tags['TIT2'].text = ['New Title']
tags.save()
Requires Python 3.10 or later (CPython or PyPy).
Verify before relying
- Whether the package's Xing header bitrate calculation is accurate enough for production audio analysis workflows.
- Performance characteristics when handling large batches of audio files or very large metadata structures.
Package facts
| License | GPL-2.0-or-later (copyleft) |
| Python support | supports the current Python release (<4,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 50 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 15,032,857/month — #1,201 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mutagen-1.48.1-py3-none-any.whl
Tags
More Sound/Audio packages
Reads and writes audio files in formats like…
permissive · top 1,000 on PyPI
pydubPydub provides a high-level Python interface…
permissive · top 5,000 on PyPI
torchaudioProvides PyTorch-based audio processing,…
permissive · top 5,000 on PyPI
moviepyMoviePy is a Python library for video editing…
permissive · top 5,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
livekit-apiGenerate access tokens and call LiveKit server…
permissive · top 5,000 on PyPI
eyeD3eyeD3 reads, edits, and displays ID3 metadata…
copyleft · top 15,000 on PyPI
mediafileMediaFile reads and writes metadata tags across…
permissive · top 15,000 on PyPI
audiofileReads and writes audio files across formats…
permissive · top 15,000 on PyPI
miniaudioMiniaudio provides Python bindings for…
permissive · top 15,000 on PyPI
playsoundPlays audio files (MP3, WAV) and URLs from…
permissive · top 15,000 on PyPI
audiolabaudiolab loads, processes, and saves audio…
permissive · top 15,000 on PyPI
gTTSgTTS converts text to speech using Google…
permissive · top 5,000 on PyPI
lameencWraps LAME MP3 encoder for Python, providing…
copyleft · top 5,000 on PyPI