Skip to main content

almighty

Format byte sizes, big counts and ratios the way a human reads them.

Install

pip install almighty

Usage

from almighty import human_count, human_ratio, human_size

human_size(0)              # '0 B'
human_size(1536)           # '1.5 KB'
human_size(1024 ** 3)      # '1.0 GB'
human_size(1500, n_base=1000)   # '1.5 KB' (decimal units)

human_count(999)           # '999'
human_count(1_200_000)     # '1.2M'

human_ratio(1, 3)          # '33.3%'
human_ratio(1, 0)          # 'n/a'

Notes

human_size uses binary units by default (1024); pass n_base=1000 for the decimal convention. human_ratio returns n/a instead of raising on a zero denominator, because that is what a report wants to show.

License

MIT

Metadata

Release files for almighty 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for almighty 0.0.2
File Size Uploaded Provenance Actions
almighty-0.0.2.tar.gz 2.7 kB Without provenance Details for almighty-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for almighty 0.0.2
File Interpreter ABI Platform Actions
almighty-0.0.2-py3-none-any.whl Python 3 none any Details for almighty-0.0.2-py3-none-any.whl

Total release size: 5.9 kB

Release files / almighty-0.0.2.tar.gz

Download URL almighty-0.0.2.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c67bd5cd25c5371a89eda0a9a0ed10f1c115a41d5de92a610a95fdb768145865
BLAKE2b-256 checksum
How to use checksums
1106c2a39ac721a5af469c1de9a6820510673eba59936212383d86fcf0f33a28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / almighty-0.0.2-py3-none-any.whl

Download URL almighty-0.0.2-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1e5af4c9c161f683a3dc393fbb8a310b1be4cb6bce6c60d7b7649816fdeff58
BLAKE2b-256 checksum
How to use checksums
4b8dbb4fbfe7d0ae95037edea209cccfc2e1385ed3bbed14f7667db9ce92f2bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for almighty 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page