Bases: pytomo.kaa_metadata.core.Media
Collection of Digial Media like CD, DVD, Directory, Playlist
Bases: object
Returns the given attribute. If the attribute is not set by the parser return ‘default’.
Media is the base class to all Media Metadata Containers. It defines the basic structures that handle metadata. Media and its derivates contain a common set of metadata attributes that is listed in keys. Specific derivates contain additional keys to the dublin core set that is defined in Media.
Register a parser to the factory.
Transform a twocc or fourcc code into a name. Returns a 2-tuple of (cc, codec) where both are strings and cc is a string in the form ‘0xXX’ if it’s a twocc, or ‘ABCD’ if it’s a fourcc. If the given code is not a known twocc or fourcc, the return value will be (None, ‘Unknown’), unless the code is otherwise a printable string in which case it will be returned as the codec.
Set default character encoding. This function also sets the global Python encoding.
Returns a UTF-8 string, converting from other character sets if necessary.
Attempts to convert a string of unknown character set to a unicode string. First it tries to decode the string based on the locale’s preferred encoding, and if that fails, fall back to UTF-8 and then latin-1. If all fails, it will force encoding to the preferred charset, replacing unknown characters. If the given object is no string, this function will return the given object.
Attempts to convert a unicode string of unknown character set to a string. First it tries to encode the string based on the locale’s preferred encoding, and if that fails, fall back to UTF-8 and then latin-1. If all fails, it will force encoding to the preferred charset, replacing unknown characters. If the given object is no unicode string, this function will return the given object.
Format a string and make sure all string or unicode arguments are converted to the correct type.