Skip to main content

Generate human-readable representations of numbers of bytes.

Project description

byteformat is a Python library and command line script for displaying numbers of bytes as strings using standards-compliant human-readable units such as ‘23 KB’ or ‘1.25 terabytes’.

  • Support for the two official and one de facto standards for bytes:
    • SI decimal units, e.g. 1000 bytes = 1 KB;

    • IEC binary units, e.g. 1024 bytes = 1 KiB;

    • Classic units, e.g. 1024 bytes = 1 KB.

  • Supports the full set of decimal prefixes from kilo- to yotta- and the binary prefixes kibi- to yobi-.

  • Generate strings using symbols (e.g. ‘KB’), abbreviated names (‘Kbyte’) or full names (‘kilobyte’).

  • Uses correct plural terms when needed.

  • Allows the caller to explicitly choose which unit to use.

  • Automatically selects the best unit for a given number of bytes.

  • Easily customise the output without subclassing.

  • Importable as a Python library module.

  • Runs as a command line script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

byteformat-0.1a.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

byteformat-0.1a.linux-i686.exe (69.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page