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-readableVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates common humanization tasks for time, file sizes, lists, and numbers using the `human_readable` library's core functions.
Review the official changelog (if available) or the project's GitHub releases for specific migration instructions before upgrading in production environments. Test thoroughly.
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.
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.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.
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`.
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.