Mutagen
What is Mutagen?
Mutagen is a Python module to handle audio metadata. It supports ASF, FLAC, M4A, Monkey's Audio, MP3, Musepack, Ogg FLAC, Ogg Speex, Ogg Theora, Ogg Vorbis, True Audio, WavPack and OptimFROG audio files. All versions of ID3v2 are supported, and all standard ID3v2.4 frames are parsed. It can read Xing headers to accurately calculate the bitrate and length of MP3s. ID3 and APEv2 tags can be edited regardless of audio format. It can also manipulate Ogg streams on an individual packet/page level.
There is a brief tutorial with several API examples.
Where do I get it?
| Filename | Size |
|---|---|
| mutagen-1.14.tar.gz | 574KB |
It can also be checked out from our Subversion repository.
$ svn co http://svn.sacredchao.net/svn/quodlibet/trunk/mutagen
Why Mutagen?
Quod Libet has more strenuous requirements in an ID3 library than most programs that deal with tags. Furthermore, most tagging libraries suck. Therefore we felt it was necessary to write our own.
- Mutagen has a simple API, that is roughly the same across all tag formats and versions, and that integrates into Python's builtin types and interfaces.
- New frame types and file formats are easily added, and the behavior of the current formats can be changed by extending them.
- Freeform keys, multiple values, Unicode, and other advanced features were considered from the start and are fully supported.
- All ID3v2 versions and all ID3v2.4 frames are covered, including rare ones like POPM or RVA2.
- We take automated testing very seriously. All bug fixes are commited with a test that prevents them from recurring, and new features are committed with a full test suite.
Real World Use
Mutagen can load every MP3 we have thrown at it (when it hasn't, we make it do so). Scripts are included so you can run the same tests on your collection.
The following software projects are using Mutagen for tagging:
- Ex Falso and Quod Libet, a flexible tagger and player
- Listen, a music player for GNOME
- Exaile, a media player aiming to be similar to KDE's AmaroK, but for GTK+
- ZOMG, a command-line player for ZSH
- Debian's version of JACK, an audio CD ripper, uses Mutagen to tag FLACs
- Amarok's replaygain script
- csikk, web-based music sharing on LAN
- Advanced Audio Architecture, management framework for digital music
- Picard, cross-platform MusicBrainz tagger
- pytagsfs, virtual file system for organizing media files by metadata
