# audio-metadata
[![PyPI](https://img.shields.io/pypi/v/audio-metadata.svg?label=PyPI)](https://pypi.org/project/audio-metadata/)
![](https://img.shields.io/badge/Python-3.6%2B-blue.svg)
[![GitHub CI](https://img.shields.io/github/workflow/status/thebigmunch/audio-metadata/CI?label=GitHub%20CI)](https://github.com/thebigmunch/audio-metadata/actions?query=workflow%3ACI)
[![Codecov](https://img.shields.io/codecov/c/github/thebigmunch/audio-metadata.svg?label=Codecov)](https://codecov.io/gh/thebigmunch/audio-metadata)
[![Docs - Stable](https://img.shields.io/readthedocs/audio-metadata/stable.svg?label=Docs%20%28Stable%29)](https://audio-metadata.readthedocs.io/en/stable/)
[![Docs - Latest](https://img.shields.io/readthedocs/audio-metadata/latest.svg?label=Docs%20%28Latest%29)](https://audio-metadata.readthedocs.io/en/latest/)
[audio-metadata](https://github.com/thebigmunch/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](https://audio-metadata.readthedocs.io/en/stable/).
For the development version, see the [latest docs](https://audio-metadata.readthedocs.io/en/latest/).
The high-level API and basic usage are covered, but more advanced features/functionality need documentation.
## TODO
If you're willing to [contribute](https://github.com/thebigmunch/audio-metadata/blob/master/.github/CONTRIBUTING.md)
your time to work on [audio-metadata](https://github.com/thebigmunch/audio-metadata/), you can:
* Post in the [Development](https://forum.thebigmunch.me/c/dev/) category on the [Discourse forum](https://forum.thebigmunch.me/).
* Browse and comment on [issues](https://github.com/thebigmunch/audio-metadata/issues) or [pull requests](https://github.com/thebigmunch/audio-metadata/pulls).
* [Open an issue](https://github.com/thebigmunch/audio-metadata/issues/new) with a bug report or feature request.
* See current [projects](https://github.com/thebigmunch/audio-metadata/projects).
* Contact me by email at mail@thebigmunch.me.
## Appreciation
Showing appreciation is always welcome.
#### Thank
[![Say Thanks](https://img.shields.io/badge/thank-thebigmunch-blue.svg?style=flat-square)](https://saythanks.io/to/thebigmunch)
Get your own thanks inbox at [SayThanks.io](https://saythanks.io/).
#### Contribute
[Contribute](https://github.com/thebigmunch/audio-metadata/blob/master/.github/CONTRIBUTING.md) by submitting bug reports, feature requests, or code.
#### Help Others/Stay Informed
[Discourse forum](https://forum.thebigmunch.me/)
#### Referrals/Donations
[![Digital Ocean](https://img.shields.io/badge/Digital_Ocean-referral-orange.svg?style=flat-square)](https://bit.ly/DigitalOcean-tbm-referral) [![Namecheap](https://img.shields.io/badge/Namecheap-referral-orange.svg?style=flat-square)](http://bit.ly/Namecheap-tbm-referral) [![PayPal](https://img.shields.io/badge/PayPal-donate-brightgreen.svg?style=flat-square)](https://bit.ly/PayPal-thebigmunch)
Raw data
{
"_id": null,
"home_page": "https://github.com/thebigmunch/audio-metadata",
"name": "audio-metadata",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "thebigmunch",
"author_email": "mail@thebigmunch.me",
"download_url": "https://files.pythonhosted.org/packages/29/a3/3e6657b60b31199ff74827e92d807e83e628503c3bc27d34186bb5306e6f/audio-metadata-0.11.1.tar.gz",
"platform": "",
"description": "# audio-metadata\n\n[![PyPI](https://img.shields.io/pypi/v/audio-metadata.svg?label=PyPI)](https://pypi.org/project/audio-metadata/)\n![](https://img.shields.io/badge/Python-3.6%2B-blue.svg) \n[![GitHub CI](https://img.shields.io/github/workflow/status/thebigmunch/audio-metadata/CI?label=GitHub%20CI)](https://github.com/thebigmunch/audio-metadata/actions?query=workflow%3ACI)\n[![Codecov](https://img.shields.io/codecov/c/github/thebigmunch/audio-metadata.svg?label=Codecov)](https://codecov.io/gh/thebigmunch/audio-metadata) \n[![Docs - Stable](https://img.shields.io/readthedocs/audio-metadata/stable.svg?label=Docs%20%28Stable%29)](https://audio-metadata.readthedocs.io/en/stable/)\n[![Docs - Latest](https://img.shields.io/readthedocs/audio-metadata/latest.svg?label=Docs%20%28Latest%29)](https://audio-metadata.readthedocs.io/en/latest/)\n\n[audio-metadata](https://github.com/thebigmunch/audio-metadata) is a library for reading and, in the future, writing audio metadata.\n\n### Why another audio metadata library? / Why not just use mutagen et al?\n\nClean and understandable code, nice API, and good UX (user experience) are the focal points of audio-metadata.\nOne or more of these things I feel are lacking from already existing alternatives\nenough to want to write something from scratch with them in mind.\nAlso, there are certain features not present in other solutions that would be prohibitively painful to add.\n\n\n### So, why should I use it?\n\nFeatures and functionality that set it apart:\n\n* Uses the Python standard load(s)/dump(s) API.\n\t* Can load filepaths, os.PathLike objects, file-like objects, and bytes-like objects.\n* Metadata objects look like a dict **and** act like a dict.\n\t* Some common libraries shadow the representation of a dict\n\t and/or dict methods but do not behave like a dict.\n\t* Supports attribute-style access that can be mixed with dict key-subscription.\n* All metadata objects have user-friendly representations.\n\t* This includes *humanized* representations of certain values\n\t like filesize, bitrate, duration, and sample rate.\n\n```\n>>> import audio_metadata\n\n>>> metadata = audio_metadata.load('05 - Heart of Hearts.flac')\n\n>>> metadata\n<FLAC ({\n\t'filepath': '05 - Heart of Hearts.flac',\n\t'filesize': '44.23 MiB',\n\t'pictures': [],\n\t'seektable': <FLACSeekTable (37 seekpoints)>,\n\t'streaminfo': <FLACStreamInfo ({\n\t\t'bit_depth': 16,\n\t\t'bitrate': '1022 Kbps',\n\t\t'channels': 2,\n\t\t'duration': '06:03',\n\t\t'md5': '3ae700893d099a5d281a5d8db7847671',\n\t\t'sample_rate': '44.1 KHz',\n\t})>,\n\t'tags': <VorbisComment ({\n\t\t'album': ['Myth Takes'],\n\t\t'artist': ['!!!'],\n\t\t'bpm': ['119'],\n\t\t'date': ['2007'],\n\t\t'genre': ['Dance Punk'],\n\t\t'title': ['Heart of Hearts'],\n\t\t'tracknumber': ['05'],\n\t})>,\n})>\n\n>>> metadata['streaminfo']\n<FLACStreamInfo ({\n\t'bit_depth': 16,\n\t'bitrate': '1022 Kbps',\n\t'channels': 2,\n\t'duration': '06:03',\n\t'md5': '3ae700893d099a5d281a5d8db7847671',\n\t'sample_rate': '44.1 KHz',\n})>\n\n>>> metadata.streaminfo.bitrate\n1022134.0362995076\n\n>>> metadata.streaminfo['duration']\n362.9066666666667\n\n>>> metadata['streaminfo'].sample_rate\n44100\n```\n\n\n## Installation\n\n``pip install -U audio-metadata``\n\n\n## Usage\n\nFor the release version, see the [stable docs](https://audio-metadata.readthedocs.io/en/stable/). \nFor the development version, see the [latest docs](https://audio-metadata.readthedocs.io/en/latest/).\n\nThe high-level API and basic usage are covered, but more advanced features/functionality need documentation.\n\n\n## TODO\n\nIf you're willing to [contribute](https://github.com/thebigmunch/audio-metadata/blob/master/.github/CONTRIBUTING.md)\nyour time to work on [audio-metadata](https://github.com/thebigmunch/audio-metadata/), you can:\n\n* Post in the [Development](https://forum.thebigmunch.me/c/dev/) category on the [Discourse forum](https://forum.thebigmunch.me/).\n* Browse and comment on [issues](https://github.com/thebigmunch/audio-metadata/issues) or [pull requests](https://github.com/thebigmunch/audio-metadata/pulls).\n* [Open an issue](https://github.com/thebigmunch/audio-metadata/issues/new) with a bug report or feature request.\n* See current [projects](https://github.com/thebigmunch/audio-metadata/projects).\n* Contact me by email at mail@thebigmunch.me.\n\n\n## Appreciation\n\nShowing appreciation is always welcome.\n\n#### Thank\n\n[![Say Thanks](https://img.shields.io/badge/thank-thebigmunch-blue.svg?style=flat-square)](https://saythanks.io/to/thebigmunch)\n\nGet your own thanks inbox at [SayThanks.io](https://saythanks.io/).\n\n#### Contribute\n\n[Contribute](https://github.com/thebigmunch/audio-metadata/blob/master/.github/CONTRIBUTING.md) by submitting bug reports, feature requests, or code.\n\n#### Help Others/Stay Informed\n\n[Discourse forum](https://forum.thebigmunch.me/)\n\n#### Referrals/Donations\n\n[![Digital Ocean](https://img.shields.io/badge/Digital_Ocean-referral-orange.svg?style=flat-square)](https://bit.ly/DigitalOcean-tbm-referral) [![Namecheap](https://img.shields.io/badge/Namecheap-referral-orange.svg?style=flat-square)](http://bit.ly/Namecheap-tbm-referral) [![PayPal](https://img.shields.io/badge/PayPal-donate-brightgreen.svg?style=flat-square)](https://bit.ly/PayPal-thebigmunch)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A library for reading and, in the future, writing metadata from audio files.",
"version": "0.11.1",
"project_urls": {
"Homepage": "https://github.com/thebigmunch/audio-metadata",
"Repository": "https://github.com/thebigmunch/audio-metadata"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "08ce04a5878c80e6d436fd436bdcf6e300eaa433876b07360dac8f94db8bb3cb",
"md5": "13d1170baa687d0a1615102ea7cb45f0",
"sha256": "f5b85ad087324c255f8d1223574c3e7d3c27b649e411d1dd54aa3bf342fe93fb"
},
"downloads": -1,
"filename": "audio_metadata-0.11.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "13d1170baa687d0a1615102ea7cb45f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6,<4.0",
"size": 41893,
"upload_time": "2020-05-14T10:50:43",
"upload_time_iso_8601": "2020-05-14T10:50:43.517471Z",
"url": "https://files.pythonhosted.org/packages/08/ce/04a5878c80e6d436fd436bdcf6e300eaa433876b07360dac8f94db8bb3cb/audio_metadata-0.11.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "29a33e6657b60b31199ff74827e92d807e83e628503c3bc27d34186bb5306e6f",
"md5": "912a3534889f9389ed273ce5ac378f5f",
"sha256": "9e7ba79d49cf048a911d5f7d55bb2715c10be5c127fe5db0987c5fe1aa7335eb"
},
"downloads": -1,
"filename": "audio-metadata-0.11.1.tar.gz",
"has_sig": false,
"md5_digest": "912a3534889f9389ed273ce5ac378f5f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6,<4.0",
"size": 37122,
"upload_time": "2020-05-14T10:50:42",
"upload_time_iso_8601": "2020-05-14T10:50:42.429162Z",
"url": "https://files.pythonhosted.org/packages/29/a3/3e6657b60b31199ff74827e92d807e83e628503c3bc27d34186bb5306e6f/audio-metadata-0.11.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-05-14 10:50:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thebigmunch",
"github_project": "audio-metadata",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "audio-metadata"
}