humanreadable
humanreadable is a Python library to convert human-readable values to other units.
What it is and what it does
humanreadable is a lightweight Python library that bridges the gap between human-friendly time and bitrate notation and numeric computation. It parses strings like '12 min 40 sec' or '1 Gbps' into Time and BitsPerSecond objects, then lets you access the value in any supported unit (seconds, milliseconds, Mbps, Kibps, etc.). It can also reverse the process: format a numeric duration back into a human-readable string like '6 minutes 40 seconds' or the compact form '6m 40s'.
The library depends only on typepy for runtime validation and is distributed as a pure Python wheel, making installation straightforward. It supports time units from days down to microseconds, and bitrate units from bps up to Tibps in both decimal (Mbps) and binary (Mibps) variants. The package is actively maintained, supports Python 3.10 through 3.14, and carries no known security vulnerabilities.
Use it for:
- Parse timeout or duration strings from configuration files or CLI arguments into seconds for use in sleep() or timeout parameters.
- Convert network bandwidth specifications (e.g. from API docs or user input) into bits per second for rate-limiting or capacity calculations.
- Format elapsed time or performance metrics back into human-readable strings for logs, reports, or user-facing output.
- Normalize time or bitrate values from different sources (some in seconds, some in minutes) into a common unit for comparison.
- Build CLI tools or config parsers that accept flexible time/bitrate notation without requiring users to specify units numerically.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses human-readable time and bitrate strings (e.g. '120 sec', '1 Gbps') and converts them to numeric values in different units, or formats numeric values back to human-readable strings.
Yes. The package solves a real parsing problem with minimal overhead—a single lightweight dependency, no security issues, and active maintenance. Install it if you need to accept or format human-readable time or bitrate strings; skip it if your code works only with numeric values already in a fixed unit.
Install
humanreadable on PyPI
pip
pip install humanreadableuv
uv add humanreadablepoetry
poetry add humanreadableInstalling humanreadable
Before you install
Low friction: pure Python wheel with a single runtime dependency (typepy). Actively maintained with a recent release (97 days ago) and last commit on 2026-07-20.
License in practice
MIT License (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
import humanreadable as hr
# Parse human-readable time
value = hr.Time("120 sec")
print(value.milliseconds) # 120000.0
print(value.minutes) # 2.0
# Parse bitrate
speed = hr.BitsPerSecond("1 Gbps")
print(speed.mega_bps) # 1000.0
Requires Python 3.10 or later.
Verify before relying
- Whether the package handles edge cases like malformed input or ambiguous unit strings gracefully.
- Performance characteristics when parsing very large batches of values.
- Exact behavior when both a numeric value and a unit specifier are provided.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typepy |
| Maintenance | actively maintained — 97 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 277,909/month — #8,141 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: humanreadable-0.4.3-py3-none-any.whl
Keywords: human-readable, converter
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
msgfyConverts Python Exception instances into…
permissive · top 15,000 on PyPI
pytimeparseParses human-readable time expressions (like…
permissive · top 1,000 on PyPI
pytimeparse2Parses human-readable time expressions (like…
permissive · top 5,000 on PyPI
agoConverts datetime, timedelta, and timestamp…
permissive · top 15,000 on PyPI
about-timeMeasures execution time and throughput of code…
permissive · top 5,000 on PyPI
human-readableConverts numbers, dates, times, file sizes, and…
permissive · top 15,000 on PyPI
humanizeConverts numbers, dates, times, and file sizes…
permissive · top 1,000 on PyPI
deltaParses human-readable duration strings like '1…
permissive · top 15,000 on PyPI
metomi-isodatetimeParses and manipulates ISO 8601 date-time…
copyleft · top 15,000 on PyPI
durationpyConverts between Python's `datetime.timedelta`…
permissive · top 1,000 on PyPI