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’.

  • Supports both official standards and the common de facto standard:

    • SI decimal units, e.g. 1000 bytes = 1 KB;

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

    • Mixed decimal names with binary sizes, 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.

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

  • Allows the caller to explicitly override that selection and select which unit to use.

  • 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.2a.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

byteformat-0.2a.linux-i686.exe (71.9 kB view details)

Uploaded Source

File details

Details for the file byteformat-0.2a.tar.gz.

File metadata

  • Download URL: byteformat-0.2a.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for byteformat-0.2a.tar.gz
Algorithm Hash digest
SHA256 b6db16a308492d8a230f315900d1a2a7235e9aa5c970d2c4ad0da85fc99b7baa
MD5 bda0636b5c9ee4d745a69576ca9321e6
BLAKE2b-256 3f5e10c1b00c0c9468ea0505e78a702ebc73a344bdb94a41db941cfe5d888cfc

See more details on using hashes here.

File details

Details for the file byteformat-0.2a.linux-i686.exe.

File metadata

File hashes

Hashes for byteformat-0.2a.linux-i686.exe
Algorithm Hash digest
SHA256 826b0dfbe2cafa5089860b90b6f70dfd5e19b93675ca1d905fa1967f2026e89f
MD5 e4f79c8fd9799fef07ea41a2790096c2
BLAKE2b-256 64a2b89b4068e86219ccd4599327333682b088bd3a6170d54c54e65ec1781cb4

See more details on using hashes here.

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