Metadata-Version: 2.5
Name: almighty
Version: 0.0.2
Summary: Human readable formatting for byte sizes, counts and ratios.
Project-URL: Homepage, https://github.com/lqxnjk/almighty
Author: lqxnjk
License: MIT
License-File: LICENSE
Keywords: bytes,format,humanize,percent,size
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# almighty

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

## Install

```console
pip install almighty
```

## Usage

```python
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
