Package: cs.id3
Support for ID3 tags.
A cs.binary based parser/transcriber for ID3 tags
and a convenience wrapper for Doug Zongker's pyid3lib:http://pyid3lib.sourceforge.net/Latest release 20211208:ID3V1 and ID3V2 support.ID3V1Frame,ID3V2Frame: new .tagset() method to return a TagSet.ID3V1Frame.parse: trim trailing NULs from the comment field.Assorted other small changes.ClassEnhancedTagFrame(cs.binary.SimpleBinary,types.SimpleNamespace,cs.binary.AbstractBinary,cs.binary.BinaryMixin)An Enhanced Tag.MethodEnhancedTagFrame.parse(bfr)Parse an enhanced tag.MethodEnhancedTagFrame.transcribe(self)Transcribe the enhanced tag.ClassID3(types.SimpleNamespace)Wrapper for pyid3lib.tag.OBSOLETE.
Going away when I'm sure the other classes cover all this stuff off.MethodID3.__getitem__(self, key)Fetch the text of the specified frame.MethodID3.__setitem__(self, key, value)Set a frame text tovalue.MethodID3.clean(self, attr)Strip NULs and leading and trailing whitespace.MethodID3.flush(self, *a, **kw)Update the ID3 tags in the file if modified, otherwise no-op.
Clears the modified flag.MethodID3.get_frame(self, frameid)Return the frame with the specifiedframeid, or None.PropertyID3.tagThe tag mapping fromself.pathname.ClassID3V1Frame(cs.binary.SimpleBinary,types.SimpleNamespace,cs.binary.AbstractBinary,cs.binary.BinaryMixin)An ID3V1 or ID3v1.1 data frame as described in wikipedia:https://en.wikipedia.org/wiki/ID3The following fields are defined:title: up to 30 ASCII charactersartist: up to 30 ASCII charactersalbum: up to 30 ASCII charactersyear: 4 digit ASCII yearcomment: up to 30 ASCII bytes, NUL or whitespace padded,
up to 28 ASCII bytes iftrackis nonzerotrack: 0 for no track, a number from 1 through 255 otherwise;
if nonzero then the comment field may only be up to 28 bytes longgenre_id: a number value from 0 to 255MethodID3V1Frame.parse(bfr)Parse a 128 byte ID3V1 or ID3v1.1 record.MethodID3V1Frame.tagset(self)Return aTagSetwith the ID3 tag information.MethodID3V1Frame.transcribe(self)Transcribe the ID3V1 frame.ClassID3V22TagDataFrame(cs.binary.SimpleBinary,types.SimpleNamespace,cs.binary.AbstractBinary,cs.binary.BinaryMixin)An ID3 v2.2.0 tag data frame.Reference doc:https://id3.org/id3v2-00MethodID3V22TagDataFrame.tag_id_class(tag_id)Return theAbstractBinarysubclass to decode the a tag body from its tag id.
ReturnNonefor unrecognised ids.ClassID3V23TagDataFrame(cs.binary.SimpleBinary,types.SimpleNamespace,cs.binary.AbstractBinary,cs.binary.BinaryMixin)An ID3 v2.3.0 tag data frame.Reference doc:https://id3.org/id3v2.3.0MethodID3V23TagDataFrame.tag_id_class(tag_id)Return theAbstractBinarysubclass to decode the a tag body from its tag id.
ReturnNonefor unrecognised ids.ClassID3V2Frame(cs.binary.SimpleBinary,types.SimpleNamespace,cs.binary.AbstractBinary,cs.binary.BinaryMixin)An ID3v2 frame, based on the document at:https://web.archive.org/web/20120527211939/http://www.unixgods.org/~tilo/ID3/docs/id3v2-00.htmlMethodID3V2Frame.parse(bfr)Return an ID3v2 frame as described here:MethodID3V2Frame.tagset(self)Return aTagSetwith the ID3 tag information.MethodID3V2Frame.transcribe(self)Transcribe the ID3v2 frame.ClassID3V2Size(cs.binary.BinarySingleValue,cs.binary.AbstractBinary,cs.binary.BinaryMixin)An ID3v2 size field,
a big endian 4 byte field of 7-bit values, high bit 0.MethodID3V2Size.parse_value(bfr)Read an ID3V2 size field frombfr, return the size.MethodID3V2Size.transcribe_value(size)Transcribe a size in ID3v2 format.ClassID3V2Tags(types.SimpleNamespace)AnID3V2Tagsmaps ID3V2 tag information as aSimpleNamespace.MethodID3V2Tags.__getattr__(self, attr)Catch frame id attrs and their wordier versions.MethodID3V2Tags.__setattr__(self, attr, value)Map attributes to frame ids, set the corresponding__dict__entry.ClassISO8859_1NULString(cs.binary.BinarySingleValue,cs.binary.AbstractBinary,cs.binary.BinaryMixin)A NUL terminated string encoded with ISO8859-1.MethodISO8859_1NULString.transcribe_value(s)pylint: disable=arguments-differFunctionpadded_text(text, length, encoding='ascii')Encodetextusingencoding,
crop to a maximum oflengthbytes,
pad with NULs tolengthif necessary.Functionparse_padded_text(bfr, length, encoding='ascii')Fetchlengthbytes frombfr,
strip trailing NULs,
decode usingencoding(default'ascii'),
strip trailling whitepsace.ClassTextEncodingClass(cs.binary.BinarySingleValue,cs.binary.AbstractBinary,cs.binary.BinaryMixin)A trite class to parse the single byte text encoding field.ClassTextInformationFrameBody(cs.binary.SimpleBinary,types.SimpleNamespace,cs.binary.AbstractBinary,cs.binary.BinaryMixin)A text information frame.MethodTextInformationFrameBody.parse(bfr)Parse the text from the frame.MethodTextInformationFrameBody.transcribe(self)Transcribe the frame.ClassUCS2NULString(cs.binary.BinarySingleValue,cs.binary.AbstractBinary,cs.binary.BinaryMixin)A NUL terminated string encoded with UCS-2.We're cheating and using UTF16 for this.MethodUCS2NULString.transcribe_value(s)Transcribe text as UTF-16-LE with leading BOM and trailing NUL.Release LogRelease 20211208:ID3V1 and ID3V2 support.ID3V1Frame,ID3V2Frame: new .tagset() method to return a TagSet.ID3V1Frame.parse: trim trailing NULs from the comment field.Assorted other small changes.Release 20160828:
Use "install_requires" instead of "requires" in DISTINFO.Release 20150116.2:
pyid3lib not on PyPI, remove from requirements and mention in READMERelease 20150116:
Initial PyPI release.