utils Package

utils Package

eyed3.utils.guessMimetype(filename)[source]

Return the mime-type for filename. If available python-magic is used to provide better type detection.

eyed3.utils.walk(handler, path, excludes=None, fs_encoding='UTF-8')[source]

A wrapper around os.walk which handles exclusion patterns and unicode conversion.

class eyed3.utils.FileHandler[source]

Bases: object

A handler interface for eyed3.utils.walk() callbacks.

handleFile(f)[source]

Called for each file walked. The file f is the full path and the return value is ignored. If the walk should abort the method should raise a StopIteration exception.

handleDirectory(d, files)[source]

Called for each directory d after handleFile has been called for each file in files. StopIteration may be raised to halt iteration.

handleDone()[source]

Called when there are no more files to handle.

eyed3.utils.requireUnicode(*args)[source]

Function decorator to enforce unicode argument types. None is a valid argument value, in all cases, regardless of not being unicode. *args Positional arguments may be numeric argument index values (requireUnicode(1, 3) - requires argument 1 and 3 are unicode) or keyword argument names (requireUnicode(“title”)) or a combination thereof.

eyed3.utils.encodeUnicode(replace=True)[source]
eyed3.utils.formatTime(curr, total=None)[source]
eyed3.utils.formatSize(sz)[source]
eyed3.utils.formatTimeDelta(td)[source]
eyed3.utils.chunkCopy(src_fp, dest_fp, chunk_sz=524288)[source]

Copy src_fp to dest_fp in chunk_sz byte increments.

binfuncs Module

eyed3.utils.binfuncs.bytes2bin(bytes, sz=8)[source]

Accepts a string of bytes (chars) and returns an array of bits representing the bytes in big endian byte order. An optional max sz for each byte (default 8 bits/byte) which can be used to mask out higher bits.

eyed3.utils.binfuncs.bin2bytes(x)[source]
eyed3.utils.binfuncs.bin2dec(x)[source]

Convert x, an array of “bits” (MSB first), to it’s decimal value.

eyed3.utils.binfuncs.bytes2dec(bytes, sz=8)[source]
eyed3.utils.binfuncs.dec2bin(n, p=1)[source]

Convert a decimal value n to an array of bits (MSB first). Optionally, pad the overall size to p bits.

eyed3.utils.binfuncs.dec2bytes(n, p=1)[source]
eyed3.utils.binfuncs.bin2synchsafe(x)[source]

Convert x, a list of bits (MSB first), to a synch safe list of bits. (section 6.2 of the ID3 2.4 spec).

eyed3.utils.binfuncs.bytes2str(bites)[source]

cli Module

class eyed3.utils.cli.ArgumentParser(*args, **kwargs)[source]

Bases: argparse.ArgumentParser

Subclass of argparse.ArgumentParser that adds version and log level options.

class eyed3.utils.cli.LoggingAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse._AppendAction

eyed3.utils.cli.getColor(color_code, fp=<open file '<stdout>', mode 'w' at 0x7fed3e7de1e0>)[source]
eyed3.utils.cli.enableColorOutput(fp, state=True)[source]

log Module

class eyed3.utils.log.Logger(name)[source]

Bases: logging.Logger

Base class for all loggers

verbose(msg, *args, **kwargs)[source]

Log  msg at ‘verbose’ level, debug < verbose < info

Table Of Contents

Previous topic

plugins Package

Next topic

Compliance

This Page