Registry / type-stubs / types-humanfriendly

types-humanfriendly

JSON →
library10.0.1.20250319pypypi✓ verified 23d ago

This is a PEP 561 type stub package providing static type annotations for the `humanfriendly` library. It enables type-checking tools like MyPy, Pyright, and PyCharm to analyze code that uses `humanfriendly`. While available on PyPI, this package is part of the Typeshed project, and direct maintenance for it has ceased; fixes should be contributed upstream to Typeshed. This version aims to provide accurate annotations for `humanfriendly==10.0.*`.

pip install types-humanfriendly
INSTALL
IMPORT
SIG · TYPES-HUMANFRIENDL
T
types-humanfriendly
type-stubspythonv10.0.1.20250319
Install
1.5s avg
Import
Disk
65MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v10.0.1.20250319 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
65MB installed
● package 65MB
Code
Verified usage

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

format_size
from humanfriendly_stubs import format_size
from humanfriendly-stubs import format_size

Install `humanfriendly` and `types-humanfriendly`. Then, import and use functions from `humanfriendly` with type annotations. Your type checker will leverage the stubs provided by `types-humanfriendly`.

import os from humanfriendly import format_size, parse_size def process_size(size_str: str) -> str: try: num_bytes = parse_size(size_str) return f"You entered: {format_size(num_bytes)}" except Exception as e: return f"Error parsing size: {e}" # Example usage (usually from user input or a configuration) user_input = os.environ.get('EXAMPLE_FILE_SIZE', '10GB') # Simulate input print(process_size(user_input))
Debug
Known issues
deprecatedThe `types-humanfriendly` package is officially unmaintained on PyPI, and the `humanfriendly` stubs were removed from the upstream Typeshed project in March 2025. This means no further updates or fixes will be provided.
fix
Consider vendoring the stubs if critical, or migrating away from `humanfriendly` if type-checking is a strict requirement for newer Python versions or accurate types. Alternatively, disable type checking for this library.
affects: 10.0.1.20250319 and later (effectively frozen)
gotchaStub versions can introduce breaking changes for type checkers even if the runtime library does not. Due to the unmaintained status, future `humanfriendly` versions may not be accurately stubbed, leading to type-checking errors.
fix
Pin `types-humanfriendly` to a specific version (e.g., `types-humanfriendly==10.0.1.20250319`) to prevent unexpected type-checking failures if newer versions of `humanfriendly` are installed and their APIs diverge from the stubbed `10.0.*` version. Always ensure the stub version aligns with your `humanfriendly` runtime version.
affects: All versions, especially when paired with `humanfriendly` versions > 10.0
gotchaThe underlying `humanfriendly` library itself has not been updated since September 2021 (version 10.0) and was noted as not working with Python 3.13 during the Typeshed removal discussion, which implies potential runtime issues with newer Python versions, separate from the stubs.
fix
Test `humanfriendly` thoroughly with your target Python version. If you encounter runtime issues, consider alternative libraries with active maintenance.
affects: humanfriendly==10.0 with Python 3.13+
Upgrade
Version history
10.0.1.20250319latest on PyPI · released Mar 19, 2025
Audit
Dependencies
humanfriendlyrequiredProvides type stubs for this runtime library; required for the stubs to be effective.
Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
types-humanfriendly — pip install types-humanfriendly · libregistry