Metadata-Version: 2.5
Name: bytesy
Version: 0.1.0
Summary: Turn byte counts into human-readable strings, like 1536000 -> '1.54 MB'.
Author: Madhusmitha
License-Expression: MIT
License-File: LICENSE
Keywords: bytes,filesize,format,human-readable
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# bytesy

Turn byte counts into human-readable strings.

```bash
pip install bytesy
```

```python
from bytesy import pretty_bytes

pretty_bytes(1536000)               # '1.54 MB'
pretty_bytes(1536000, binary=True)  # '1.46 MiB'
pretty_bytes(1536000, precision=0)  # '2 MB'
pretty_bytes(0)                     # '0 B'
pretty_bytes(-2048)                 # '-2.05 kB'
```

## Options

| Argument    | Default | Meaning                                                   |
|-------------|---------|-----------------------------------------------------------|
| `binary`    | `False` | Use powers of 1024 (KiB, MiB, ...) instead of 1000 (kB, MB, ...) |
| `precision` | `2`     | Maximum decimal places; trailing zeros are dropped        |

## License

MIT
