Skip to main content

Format and sort byte values like 25.6MB, 5.6KB

Project description

sortbybytes

Sort and format human-readable byte-size strings.

sortbybytes provides two simple, yet powerful functions:

  • get_size(bytes, suffix="B") — Convert an integer byte count into a human-readable string (e.g. 1253656 → "1.20 MB").
  • sortvalue(values, reverse=False) — Sort a list of human-readable byte-size strings (e.g. "25.6 MB", "5.6 KB", "12.5 GB") in ascending (default) or descending order.

🚀 Installation

pip install sortbybytes

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

sortbybytes-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sortbybytes-0.1.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file sortbybytes-0.1.2.tar.gz.

File metadata

  • Download URL: sortbybytes-0.1.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for sortbybytes-0.1.2.tar.gz
Algorithm Hash digest
SHA256 acc9377e1fcc37e43c222b137c8930bb36d38c80793880b95ab34744dd0d7d1b
MD5 ff30495e1d6f2846ae5a5deee213b4b9
BLAKE2b-256 244f7604be567b271e91a18a192461efa7dab90ef89bec8f42e498fe7e38a1c9

See more details on using hashes here.

File details

Details for the file sortbybytes-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sortbybytes-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for sortbybytes-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be55cd893ed8b49d0ea1c961c7d6cbaf84d7b740059ce0a18dede4d88ff514c7
MD5 35fbfc672f22294ab6d4c3a3e7cb3fc7
BLAKE2b-256 8f296ce6f353a47c5e53ba37627a1aba3b22cf52ee4ffe43e318445a33930a57

See more details on using hashes here.

Supported by

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