Skip to main content

audio-metadata

PyPI
GitHub CI Codecov
Docs - Stable Docs - Latest

audio-metadata is a library for reading and, in the future, writing audio metadata.

Why another audio metadata library? / Why not just use mutagen et al?

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.

So, why should I use it?

Features and functionality that set it apart:

  • Uses the Python standard load(s)/dump(s) API.
    • Can load filepaths, os.PathLike objects, file-like objects, and bytes-like objects.
  • Metadata objects look like a dict and act like a dict.
    • Some common libraries shadow the representation of a dict and/or dict methods but do not behave like a dict.
    • Supports attribute-style access that can be mixed with dict key-subscription.
  • All metadata objects have user-friendly representations.
    • This includes humanized representations of certain values like filesize, bitrate, duration, and sample rate.
>>> 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

Installation

pip install -U audio-metadata

Usage

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.

TODO

If you're willing to contribute your time to work on audio-metadata, you can:

Appreciation

Showing appreciation is always welcome.

Thank

Say Thanks

Get your own thanks inbox at SayThanks.io.

Contribute

Contribute by submitting bug reports, feature requests, or code.

Help Others/Stay Informed

Discourse forum

Referrals/Donations

Digital Ocean Namecheap PayPal

Metadata

Release files for audio-metadata 0.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audio-metadata 0.11.1
File Size Uploaded
audio-metadata-0.11.1.tar.gz 37.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for audio-metadata 0.11.1
File Interpreter ABI Platform
audio_metadata-0.11.1-py3-none-any.whl Python 3 none any Details

Total release size: 79.0 kB

Release files / audio-metadata-0.11.1.tar.gz

Download URL audio-metadata-0.11.1.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9e7ba79d49cf048a911d5f7d55bb2715c10be5c127fe5db0987c5fe1aa7335eb
BLAKE2b-256 checksum
How to use checksums
29a33e6657b60b31199ff74827e92d807e83e628503c3bc27d34186bb5306e6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Linux/5.3.0-1020-azure

Release files / audio_metadata-0.11.1-py3-none-any.whl

Download URL audio_metadata-0.11.1-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5b85ad087324c255f8d1223574c3e7d3c27b649e411d1dd54aa3bf342fe93fb
BLAKE2b-256 checksum
How to use checksums
08ce04a5878c80e6d436fd436bdcf6e300eaa433876b07360dac8f94db8bb3cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Linux/5.3.0-1020-azure

Release history Release notifications | RSS feed

This release

0.11.1 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page