Registry / data / human-readable

human-readable

JSON →
library2.0.3pypypi✓ verified 85d ago

The `human-readable` library provides a collection of utilities to convert various data types, such as numbers, dates, times, file sizes, and lists, into a more human-friendly and readable format. It aims to enhance user experience by presenting machine-generated data in an intuitive way. The current version is 2.0.2 and it is actively maintained, with the latest release on March 26, 2026.

pip install human-readable
INSTALL
IMPORT
SIG · HUMAN-READABLE
H
human-readable
datapythonv2.0.3
Install
1.5s avg
Import
27ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.029s · 18.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.026s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

human_readable
import human_readable
import humanreadable
The correct import for this library uses an underscore (`human_readable`), not `humanreadable` (which is a different library) or `humanize` (another similar library).

This quickstart demonstrates common humanization tasks for time, file sizes, lists, and numbers using the `human_readable` library's core functions.

import human_readable import datetime as dt # Date and time humanization print(human_readable.time_of_day(17)) print(human_readable.time_delta(dt.timedelta(seconds=3665))) # File size humanization print(human_readable.file_size(2900000)) # List humanization print(human_readable.listing(['apple', 'banana', 'orange'])) # Numbers humanization print(human_readable.int_comma(123456789)) print(human_readable.int_word(123456789))
Debug
Known issues
breakingUpgrading from `human-readable` 1.x to 2.x may introduce breaking changes. While not explicitly detailed in the public release notes, major version increments (e.g., 1.x to 2.x) typically indicate backward-incompatible API changes following Semantic Versioning principles.
fix
Review the official changelog (if available) or the project's GitHub releases for specific migration instructions before upgrading in production environments. Test thoroughly.
affects: >=2.0.0
gotchaThere are several Python libraries with similar names or functionalities (e.g., `humanize`, `humanreadable`, `humanfriendly`). Ensure you are importing and using functions from the correct `human_readable` package to avoid unexpected behavior or `AttributeError`s.
fix
Always use `import human_readable` and refer to functions with the `human_readable.` prefix. Double-check documentation for the specific library you intend to use.
affects: All
gotchaLocalization (i18n) requires explicit activation. If humanization functions return English strings despite your environment being set to another locale, the library's locale might not be activated correctly.
fix
Activate the desired locale using `human_readable.i18n.activate('your_locale_code')`. For example, `human_readable.i18n.activate('es_ES')`. Ensure the locale data is available if specifying a custom path.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'humanize'
Attempting to import `humanize` when `human-readable` is installed, or vice-versa. These are distinct libraries.
fix
If you intended to use `human-readable`, use `import human_readable`. If you intended `humanize`, ensure it's installed via `pip install humanize` and import it correctly.
AttributeError: module 'human_readable' has no attribute 'some_function'
Trying to use a function (e.g., `naturaltime`, `filesize`) that exists in a different humanization library (like `humanize` or `humanreadable`) but not in `human-readable`, or a function that has been renamed or removed in a newer version.
fix
Consult the `human-readable` documentation (or the specific version's docs) for the correct function names and their usage. For example, `humanize.naturaltime` is `human_readable.time_delta` or `human_readable.date_time` in this library. `humanize.filesize` is `human_readable.file_size`.
TypeError: 'float' object cannot be interpreted as an integer
Passing a float to a function that strictly expects an integer, such as `human_readable.time_of_day`, or an incorrect type to other humanization functions.
fix
Ensure the input data type matches the function's expected arguments. Convert floats to integers if appropriate, or use functions designed for floats (e.g., `human_readable.scientific`, `human_readable.fractional`) if that's the desired outcome.
Upgrade
Version history
2.0.3latest on PyPI · released Apr 24, 2026
Audit
Dependencies
PythonrequiredRequires Python 3.9 or newer.
Agent activity
8 hits · last 30 days
node
8
Resources
human-readable — pip install human-readable · libregistry