toil.lib.humanize

Module Contents

Functions

bytes2human(n)

Convert n bytes into a human readable string.

human2bytes(s)

Attempts to guess the string format based on default symbols

Attributes

logger

toil.lib.humanize.logger
toil.lib.humanize.bytes2human(n)[source]

Convert n bytes into a human readable string.

Parameters:

n (SupportsInt) –

Return type:

str

toil.lib.humanize.human2bytes(s)[source]

Attempts to guess the string format based on default symbols set and return the corresponding bytes as an integer.

When unable to recognize the format ValueError is raised.

Parameters:

s (str) –

Return type:

int