audio-metadata is a library for reading and, in the future, writing audio metadata.
Clean and understandable code, nice API, and good UX (user experience) are the focal points of audio-metadata. One or more of these things I feel are lacking from already existing alternatives enough to want to write something from scratch with them in mind. Also, there are certain features not present in other solutions that would be prohibitively painful to add.
Features and functionality that set it apart:
>>> import audio_metadata
>>> metadata = audio_metadata.load('05 - Heart of Hearts.flac')
>>> metadata
<FLAC ({
'filepath': '05 - Heart of Hearts.flac',
'filesize': '44.23 MiB',
'pictures': [],
'seektable': <FLACSeekTable (37 seekpoints)>,
'streaminfo': <FLACStreamInfo ({
'bit_depth': 16,
'bitrate': '1022 Kbps',
'channels': 2,
'duration': '06:03',
'md5': '3ae700893d099a5d281a5d8db7847671',
'sample_rate': '44.1 KHz',
})>,
'tags': <VorbisComment ({
'album': ['Myth Takes'],
'artist': ['!!!'],
'bpm': ['119'],
'date': ['2007'],
'genre': ['Dance Punk'],
'title': ['Heart of Hearts'],
'tracknumber': ['05'],
})>,
})>
>>> metadata['streaminfo']
<FLACStreamInfo ({
'bit_depth': 16,
'bitrate': '1022 Kbps',
'channels': 2,
'duration': '06:03',
'md5': '3ae700893d099a5d281a5d8db7847671',
'sample_rate': '44.1 KHz',
})>
>>> metadata.streaminfo.bitrate
1022134.0362995076
>>> metadata.streaminfo['duration']
362.9066666666667
>>> metadata['streaminfo'].sample_rate
44100
pip install -U audio-metadata
For the release version, see the stable docs.
For the development version, see the latest docs.
The high-level API and basic usage are covered, but more advanced features/functionality need documentation.
If you're willing to contribute your time to work on audio-metadata, you can:
Showing appreciation is always welcome.
Get your own thanks inbox at SayThanks.io.
Contribute by submitting bug reports, feature requests, or code.