accessories

Accessory functions.

encoding_from_lang(lang)

Parse encoding from LANG environment value.

Example:

>>> encoding_from_lang('en_US.UTF-8@misc')
'UTF-8'
name_unicode(ucs)

Return 7-bit ascii printable of any string.

eightbits(number)

Binary representation of number padded to 8 bits.

Example:

>>> eightbits(ord('a'))
'0b01100001'
make_logger(name, loglevel='info', logfile=None, logfmt='%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(message)s')

Create and return simple logger for given arguments.

repr_mapping(mapping)

Return printable string, ‘key=value [key=value ...]’ for mapping.

function_lookup(pymod_path)

Return callable function target from standard module.function path.

make_reader_task(reader, size=4096)

Return asyncio task wrapping coroutine of reader.read(size).