High level interface for pytag. Creates a new object if the audio format is supported, or returns a pytag.FormatNotSupportedError if not.
Extends pytag.AudioReader and adds a write_tags method.
Base class to read/write vorbis comments as defined at: http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html
Reads the comments.
Parameters: | packet (pytag.containers.PacketReader) – Object to read from, has a read method. |
---|---|
Returns: | A dict-like object with all the comments. |
Return type: | pytag.structures.CaseInsensitiveDict |
Bases: pytag.codecs.VorbisComment
Default comments/tags accepted by pytag
Get the complete page as bytes.
Paramer update_crc: | |
---|---|
Flag to know if recalculate the CRC. | |
Returns: | Ogg page |
Return type: | array.array of bytes, typecode = ‘B’ |
Gets the size of the next packet (or partial packet) in the current page. This size can be smaller than the full packet because a packet can we splited in severa pages. Also check it the packet finish in the current page. If page has no more bytes to read, this function iterates to the next page. The idea is use this function as callback in PacketReader, this way, when a packet is readed, the reader doesn’t need to worry about how the packet is saved inside an ogg stream.
Returns: | Next packet size and if the packet finish in this page. |
---|---|
Return type: | collections.namedtuple of type PacketInfo |
Get a packet reader for the current page.
Returns: | A packet reader over the same stream used by this OggPage |
---|---|
Return type: | PacketReader |
Check if the page is the last in a logical bitstream. :returns: True if is the last one, False if not. :rtype: boolean
Iterates to next page.
Iterator over still not readed pages.
Returns the page number where the comments start.
Returns the comments.
A case-insensitive dict-like object.
Implements all methods and operations of collections.abc.MutableMapping as well as dict’s dict.copy().
All keys are expected to be strings. The structure always set the key to lower case.
cid = CaseInsensitiveDict()
cid['Key'] = 'value'
cid['KEY'] == 'value' # True
list(cid) == ['key'] # True
If the constructor, update, or equality comparison operations are given keys that have equal str.lower(), the behavior is undefined.
A case-insensitive dict-like object where only the values defines in pytag.constants.FIELD_NAMES constant are allowed as keys. If a key is not valid, is ignored without any warning.