bytesize._constants module
Constants used by the bytesize package.
- Categories of constants:
- Rounding methods
- Size units, e.g., Ki, Mi
-
class bytesize._constants.BinaryUnits
Bases: object
Class to store binary unit constants.
-
EiB = EiB
-
FACTOR = 1024
-
GiB = GiB
-
KiB = KiB
-
MiB = MiB
-
PiB = PiB
-
TiB = TiB
-
classmethod UNITS()
Units of this class.
-
YiB = YiB
-
ZiB = ZiB
-
class bytesize._constants.DecimalUnits
Bases: object
Class to store decimal unit constants.
-
EB = EB
-
FACTOR = 1000
-
GB = GB
-
KB = kB
-
MB = MB
-
PB = PB
-
TB = TB
-
classmethod UNITS()
Units of this class.
-
YB = YB
-
ZB = ZB
-
class bytesize._constants.RoundingMethods
Bases: object
Static class for accessing rounding methods.
-
classmethod METHODS()
Methods of this class.
-
ROUND_DOWN = Round down.
-
ROUND_HALF_DOWN = Round to nearest, down on a tie.
-
ROUND_HALF_UP = Round to nearest, up on a tie.
-
ROUND_UP = Round up.
-
bytesize._constants.UNITS()
All unit constants.
-
class bytesize._constants.Unit(factor, prefix, abbr)
Bases: object
Class to encapsulate unit information.
-
abbr
abbreviation for unit, precedes ‘B’
-
factor
numeric multiple of bytes
-
prefix
prefix for ‘bytes’