===========
id3parse.py
===========
An ID3 parser and serializer for Python 3.
Example Usage
=============
Creating an ID3 tag from scratch
--------------------------------
Input::
from id3parse import ID3, ID3TextFrame
id3 = ID3.from_scratch()
id3.add_frame(ID3TextFrame.from_scratch('TIT2', 'Why Don\'t You Get A Job?'))
id3.add_frame(ID3TextFrame.from_scratch('TPE1', 'The Offspring'))
print(id3.serialize())
Output::
b'ID3\x04\x00\x00\x00\x00\x00=TIT2\x00\x00\x00\x1a\x00\x00\x03Why Don\'t You Get A Job?\x00TPE1\x00\x00\x00\x0f\x00\x00\x03The Offspring\x00'
Parsing an ID3 tag
------------------
Input::
from id3parse import ID3
id3 = ID3.from_byte_array(b'ID3\x04\x00\x00\x00\x00\x00=TIT2\x00\x00\x00\x1a\x00\x00\x03Why Don\'t You Get A Job?\x00TPE1\x00\x00\x00\x0f\x00\x00\x03The Offspring\x00')
for f in id3.frames:
print(f)
Output::
TIT2: Why Don't You Get A Job?
TPE1: The Offspring
Loading and saving an ID3 tag
-----------------------------
::
from id3parse import ID3, ID3TextFrame
id3 = ID3.from_file('01 - The Offspring - Why Dont You Get A Job.mp3')
id3.add_frame(ID3TextFrame.from_scratch('TPE1', 'The Offspring'))
id3.add_frame(ID3TextFrame.from_scratch('TIT2', 'Why Don\'t You Get A Job?'))
id3.to_file()
Querying frames
---------------
::
from id3parse import ID3, ID3TextFrame
id3 = ID3.from_file('01 - The Offspring - Why Dont You Get A Job.mp3')
tpe1 = id3.find_frame_by_name('TPE1') # Returns a frame, fails if more than one
tpe1.text = 'The Offspring' # frame with this name is available
privs = id3.find_frames_by_name('PRIV') # Returns a list of frames
for priv in privs:
print(priv)
id3.to_file()
Raw data
{
"_id": null,
"home_page": "https://github.com/frececroka/id3parse.py",
"name": "id3parse",
"maintainer": "",
"docs_url": null,
"requires_python": null,
"maintainer_email": "",
"keywords": "",
"author": "Lorenz Gorse",
"author_email": "lorenz.gorse+id3parse@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d9/fa/ab128ac6534bd6ab2ecceaa9b71844d2d45245df2f746e82b19020c8fd26/id3parse-0.1.1.tar.gz",
"platform": "",
"description": "===========\r\nid3parse.py\r\n===========\r\n\r\nAn ID3 parser and serializer for Python 3.\r\n\r\nExample Usage\r\n=============\r\n\r\nCreating an ID3 tag from scratch\r\n--------------------------------\r\n\r\nInput::\r\n\r\n from id3parse import ID3, ID3TextFrame\r\n\r\n id3 = ID3.from_scratch()\r\n\r\n id3.add_frame(ID3TextFrame.from_scratch('TIT2', 'Why Don\\'t You Get A Job?'))\r\n id3.add_frame(ID3TextFrame.from_scratch('TPE1', 'The Offspring'))\r\n\r\n print(id3.serialize())\r\n\r\nOutput::\r\n\r\n b'ID3\\x04\\x00\\x00\\x00\\x00\\x00=TIT2\\x00\\x00\\x00\\x1a\\x00\\x00\\x03Why Don\\'t You Get A Job?\\x00TPE1\\x00\\x00\\x00\\x0f\\x00\\x00\\x03The Offspring\\x00'\r\n\r\nParsing an ID3 tag\r\n------------------\r\n\r\nInput::\r\n\r\n from id3parse import ID3\r\n\r\n id3 = ID3.from_byte_array(b'ID3\\x04\\x00\\x00\\x00\\x00\\x00=TIT2\\x00\\x00\\x00\\x1a\\x00\\x00\\x03Why Don\\'t You Get A Job?\\x00TPE1\\x00\\x00\\x00\\x0f\\x00\\x00\\x03The Offspring\\x00')\r\n\r\n for f in id3.frames:\r\n print(f)\r\n\r\nOutput::\r\n\r\n TIT2: Why Don't You Get A Job?\r\n TPE1: The Offspring\r\n\r\nLoading and saving an ID3 tag\r\n-----------------------------\r\n\r\n::\r\n\r\n from id3parse import ID3, ID3TextFrame\r\n\r\n id3 = ID3.from_file('01 - The Offspring - Why Dont You Get A Job.mp3')\r\n\r\n id3.add_frame(ID3TextFrame.from_scratch('TPE1', 'The Offspring'))\r\n id3.add_frame(ID3TextFrame.from_scratch('TIT2', 'Why Don\\'t You Get A Job?'))\r\n\r\n id3.to_file()\r\n\r\nQuerying frames\r\n---------------\r\n\r\n::\r\n\r\n from id3parse import ID3, ID3TextFrame\r\n\r\n id3 = ID3.from_file('01 - The Offspring - Why Dont You Get A Job.mp3')\r\n\r\n tpe1 = id3.find_frame_by_name('TPE1') # Returns a frame, fails if more than one\r\n tpe1.text = 'The Offspring' # frame with this name is available\r\n\r\n privs = id3.find_frames_by_name('PRIV') # Returns a list of frames\r\n for priv in privs:\r\n print(priv)\r\n\r\n id3.to_file()",
"bugtrack_url": null,
"license": "MIT",
"summary": "A parser and serializer for ID3v2 tags",
"version": "0.1.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d9faab128ac6534bd6ab2ecceaa9b71844d2d45245df2f746e82b19020c8fd26",
"md5": "20611aca4ff0ceb7b94a3d0287267a10",
"sha256": "af62e8d983d728404a63f68cd03cefbbe9523b60b9c200aaf245df17a7f67408"
},
"downloads": -1,
"filename": "id3parse-0.1.1.tar.gz",
"has_sig": true,
"md5_digest": "20611aca4ff0ceb7b94a3d0287267a10",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4887,
"upload_time": "2014-06-22T15:14:29",
"upload_time_iso_8601": "2014-06-22T15:14:29.565777Z",
"url": "https://files.pythonhosted.org/packages/d9/fa/ab128ac6534bd6ab2ecceaa9b71844d2d45245df2f746e82b19020c8fd26/id3parse-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2014-06-22 15:14:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "frececroka",
"github_project": "id3parse.py",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "id3parse"
}