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.1.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.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sortbybytes-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0e9e3d180ea3a92a6ca0b204b7f5f6ee5cfb2961f59c406860ac238f7dfe8f61
MD5 81962e299928291adb4b9ee5f2aba067
BLAKE2b-256 925f40ea898e55738b3f3c9e7b3954bf9da8b4bb5cc8bea20c8dab398b3d2cb0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sortbybytes-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 033e4f509c116d5aff6878c39627b020c1c51a4cf011eee4460a26f2894724c3
MD5 3f75a62edc0b324ba3cf274849879c5e
BLAKE2b-256 635e744251dcc7809f7f1333005132757bebd5a1411791c89bf793f8590336ed

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