toolrack.convert¶
Utilities for unit conversion.
-
toolrack.convert.
BYTE_SUFFIXES
= (None, 'kib', 'mib', 'gib', 'tib', 'pib', 'eib', 'zib', 'yib')¶ Binary byte multipliers
-
toolrack.convert.
convert_bbyte
(value, suffix=None, to=None)¶ Convert a binary byte value across multipliers.
Parameters: - value (int) – the current value.
- suffix (str) – the current multiplier for the value (
None
for bytes). - to (str) – the target multiplier (
None
for bytes).