Note
This documentation is still incomplete and it’s recommended to read the source for the full details.
Mutagen is a Python module to handle audio metadata. It supports ASF, FLAC, M4A, Monkey’s Audio, MP3, Musepack, Ogg Opus, Ogg FLAC, Ogg Speex, Ogg Theora, Ogg Vorbis, True Audio, WavPack, OptimFROG, and AIFF 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.
Mutagen works on Python 2.6, 2.7, 3.3, 3.4 (CPython and PyPy) and has no dependencies outside the Python standard library.
There is a brief tutorial with several API examples.
Mutagen is hosted on Bitbucket. The download page will have the latest version or check out the Mercurial repository:
$ hg clone https://bitbucket.org/lazka/mutagen
Quod Libet has more strenuous requirements in a tagging library than most programs that deal with tags. Furthermore, most tagging libraries suck. Therefore we felt it was necessary to write our own.
Mutagen can load nearly 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:
For historical and practical reasons, Mutagen shares a mailing list and IRC channel (#quodlibet on irc.oftc.net) with Quod Libet. If you need help using Mutagen or would like to discuss the library, please use the mailing list. Bugs and patches should go to the issue tracker.