--- id: humanreadable version: "0.4.3" license: MIT License license_treatment: permissive maintenance: active --- # humanreadable — humanreadable is a Python library to convert human-readable values to other units. License: permissive · Maintenance: active · Downloads: 277.9K/mo ## 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 above — 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 pip install humanreadable uv add humanreadable poetry add humanreadable ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 277.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags parse human readable time, convert time units, bitrate string parser, human readable to seconds, time duration converter, bits per second converter, format duration human readable, unit-conversion, parsing [View on SkillFed](https://skillfed.io/packages/humanreadable) · [View on PyPI](https://pypi.org/project/humanreadable/)