{ "info": { "author": "Kristofor Maynard", "author_email": "kristofor.maynard@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# music-tag\n\nmusic-tag is a library for editing audio metadata with an interface\nthat does not depend on the underlying file format. In other words, editing\nmp3 files shouldn not be any different than flac, m4a, ... This library is\njust a layer on top of [mutagen](https://mutagen.readthedocs.io/en/latest/),\nwhich does all the heavy lifting.\n\n## Formats\n\nThe following file formats are actively tested.\n\n- ``aac``\n- ``aiff``\n- ``dsf``\n- ``flac``\n- ``m4a``\n- ``mp3``\n- ``ogg``\n- ``opus``\n- ``wav``\n- ``wv``\n\n## Keys\n\nMetadata is available using a dictionary-like interface with the following keys.\nKeys are not case sensitive and can contain arbitrary whitespace, '-', and '_'\ncharacters. In other words, ``Album Artist``, ``album-artist``, and\n``album_artist`` are all synonyms for ``albumartist``. Also, ``disk`` is synonymous with ``disc``.\n\n- ``album``\n- ``albumartist``\n- ``artist``\n- ``artwork``\n- ``comment``\n- ``compilation``\n- ``composer``\n- ``discnumber``\n- ``genre``\n- ``lyrics``\n- ``totaldiscs``\n- ``totaltracks``\n- ``tracknumber``\n- ``tracktitle``\n- ``year``\n\n## Examples\n\n### Reading tags\n\n``` python\nimport music_tag\n\nf = music_tag.load_file(\"music-tag/sample/440Hz.m4a\")\n\n# dict access returns a MetadataItem\ntitle_item = f['title']\n\n# MetadataItems keep track of multi-valued keys\ntitle_item.values # -> ['440Hz']\n\n# A single value can be extracted\ntitle_item.first # -> '440Hz'\ntitle_item.value # -> '440Hz'\n\n# MetadataItems can also be cast to a string\nstr(title_item) # -> '440Hz'\n```\n\n### Setting tags\n\n``` python\n# tags can be set as if the file were a dictionary\nf['title'] = '440Hz'\n\n# additional values can be appended to the tags\nf.append_tag('title', 'subtitle')\ntitle_item.values # -> ['440Hz', 'subtitle']\ntitle_item.first # -> '440Hz'\ntitle_item.value # -> '440Hz, subtitle'\nstr(title_item) # -> '440Hz, subtitle'\n```\n\n### Removing tags\n\n``` python\ndel f['title']\nf.remove_tag('title')\n```\n\n### Album artwork\n\nAlbum artwork is wrapped in an object that keeps track of some of the\nextra metadata associated with images. Note that some album art functionality\nrequires the Pillow (modern day PIL) library.\n\n``` python\n# get artwork\nart = f['artwork']\n\n# Note: `art` is a MetadataItem. Use ``art.value`` if there is\n# only one image embeded in the file. This will raise a\n# ValueError if there is more than one image. You can also\n# use ``art.first``, or iterate through ``art.values``.\n\nart.first.mime # -> 'image/jpeg'\nart.first.width # -> 1280\nart.first.height # -> 1280\nart.first.depth # -> 24\nart.first.data # -> b'... raw image data ...'\n\n# set artwork\nwith open('music_tag/test/sample/imgA.jpg', 'rb') as img_in:\n f['artwork'] = img_in.read()\nwith open('music_tag/test/sample/imgB.jpg', 'rb') as img_in:\n f.append_tag('artwork', img_in.read())\n\n# Make a thumbnail (requires Pillow)\nart.first.thumbnail([64, 64]) # -> pillow image\nart.first.raw_thumbnail([64, 64]) # -> b'... raw thumbnail data ...'\n```\n\n### Saving tags\n\n``` python\n# finally, you can bounce the edits to disk\nf.save()\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/KristoforMaynard/music-tag/archive/0.2.0.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/KristoforMaynard/music-tag", "keywords": "music,metadata,id3", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "music-tag", "package_url": "https://pypi.org/project/music-tag/", "platform": "", "project_url": "https://pypi.org/project/music-tag/", "project_urls": { "Download": "https://github.com/KristoforMaynard/music-tag/archive/0.2.0.zip", "Homepage": "https://github.com/KristoforMaynard/music-tag" }, "release_url": "https://pypi.org/project/music-tag/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Simple interface to edit audio file metadata", "version": "0.2.0" }, "last_serial": 5197057, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "095ea8728c895ab64b931b56ae08d6e0", "sha256": "6657e78d568d08d8063109bdc91678e6f4c69c795c1f5ade2d0d55a89a263ea6" }, "downloads": -1, "filename": "music-tag-0.2.0.tar.gz", "has_sig": false, "md5_digest": "095ea8728c895ab64b931b56ae08d6e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17306, "upload_time": "2019-04-27T16:12:26", "url": "https://files.pythonhosted.org/packages/e8/78/c03fd87e27ac607ceab4d45b1fc2b1538472a1a3135db67f098496584b12/music-tag-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "095ea8728c895ab64b931b56ae08d6e0", "sha256": "6657e78d568d08d8063109bdc91678e6f4c69c795c1f5ade2d0d55a89a263ea6" }, "downloads": -1, "filename": "music-tag-0.2.0.tar.gz", "has_sig": false, "md5_digest": "095ea8728c895ab64b931b56ae08d6e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17306, "upload_time": "2019-04-27T16:12:26", "url": "https://files.pythonhosted.org/packages/e8/78/c03fd87e27ac607ceab4d45b1fc2b1538472a1a3135db67f098496584b12/music-tag-0.2.0.tar.gz" } ] }