Skip to main content

lillib

A small collection of utility functions for Python.

Installation

You can install the package via pip:

pip install lillib

Usage

Human-readable byte sizes

Convert byte sizes into human-readable strings:

from lillib import humanbytes

# Basic usage (uses binary 1024-based units with IEC prefixes by default)
print(humanbytes(1024))  # "1.00 KiB"
print(humanbytes(1500000))  # "1.43 MiB"

# Using decimal (1000-based) units
print(humanbytes(1000, decimal=True))  # "1.00 KB"

# Control decimal places
print(humanbytes(1024, sigfig=0))  # "1 KiB"
print(humanbytes(1024, sigfig=3))  # "1.000 KiB"

# Control IEC strictness for binary units
print(humanbytes(1024, strict_iec=False))  # "1.00 KB" (non-strict)

Features

  • humanbytes(): Convert byte sizes into human-readable strings with appropriate unit prefixes
    • Support for both decimal (1000-based) and binary (1024-based) units
    • Support for IEC standard binary prefixes (KiB, MiB, GiB) or traditional prefixes

License

This project is licensed under the GNU Affero General Public License v3 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for lillib 0.2.0

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

Source distribution (sdist)

Source distribution for lillib 0.2.0
File Size Uploaded Provenance Actions
lillib-0.2.0.tar.gz 15.6 kB Without provenance Details for lillib-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 31.7 kB

Release files / lillib-0.2.0.tar.gz

Download URL lillib-0.2.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1f6a69be283eb84b0e7c8c92d314244b4421545267e0091f1a8b305357517f26
BLAKE2b-256 checksum
How to use checksums
cf6a69b7984ea353ed3e8c0c8c8e93c20d8f4a9d4214f96caa8089b9c91c1847
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release files / lillib-0.2.0-py3-none-any.whl

Download URL lillib-0.2.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ad561280d8a9f177b5e18eb5b457dcc3af6c8e31fa80cdcecc84ee0cc07ab4e
BLAKE2b-256 checksum
How to use checksums
9092d36431783996c2cb04c0d66ee4586574591fef4f1d696db32232a5fb816e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Security for lillib 0.2.0

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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