Metadata-Version: 2.5
Name: sizestr
Version: 2.0.1
Summary: Format byte counts as human-readable binary units
Project-URL: Issues, https://github.com/Zaczero/pkgs/issues
Project-URL: Repository, https://github.com/Zaczero/pkgs/tree/main/sizestr
Author-email: Kamil Monicz <kamil@monicz.dev>
License-Expression: 0BSD
License-File: LICENSE.md
Keywords: file-size,human-readable,humanize,stringify
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zero-Clause BSD (0BSD)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# sizestr

[![PyPI - Python Version](https://shields.monicz.dev/pypi/pyversions/sizestr)](https://pypi.org/p/sizestr)

Human-readable byte counts for Python 3.11+.

## Installation

```sh
pip install sizestr
```

## Format byte counts

```py
from sizestr import sizestr

print(sizestr(10_000))  # 9.77 KiB
print(sizestr(-42))     # -42 B
```

## sizestr reference

`sizestr(size)` accepts an integer or float and returns display text. Units use
powers of 1024, from bytes through ZiB. Bytes are truncated to integers; scaled
values use two decimal places below 10 and one otherwise.

Non-finite values display as `(inf)`, `(-inf)`, or `(nan)`. Values beyond ZiB
display as `(too large to display)`.

[Full reference](https://raw.githubusercontent.com/Zaczero/pkgs/sizestr/2.0.1/sizestr/sizestr/__init__.py) ·
[Issues and questions](https://github.com/Zaczero/pkgs/issues) ·
[Private security reports](https://github.com/Zaczero/pkgs/security/advisories/new) ·
[Premium support](https://monicz.dev/#get-in-touch)
