{"id":5535,"library":"types-humanfriendly","title":"Typing Stubs for humanfriendly","description":"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.*`.","status":"deprecated","version":"10.0.1.20250319","language":"en","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing","stubs","type-checking","typeshed","humanfriendly","deprecated"],"install":[{"cmd":"pip install types-humanfriendly","lang":"bash","label":"Install types-humanfriendly"},{"cmd":"pip install humanfriendly","lang":"bash","label":"Install the runtime library"}],"dependencies":[{"reason":"Provides type stubs for this runtime library; required for the stubs to be effective.","package":"humanfriendly","optional":false}],"imports":[{"note":"Imports are from the `humanfriendly` library itself; `types-humanfriendly` provides the `.pyi` files used by type checkers.","symbol":"format_size","correct":"from humanfriendly import format_size"},{"note":"Imports are from the `humanfriendly` library itself; `types-humanfriendly` provides the `.pyi` files used by type checkers.","symbol":"parse_size","correct":"from humanfriendly import parse_size"},{"note":"Imports are from the `humanfriendly` library itself; `types-humanfriendly` provides the `.pyi` files used by type checkers.","symbol":"prompt_for_input","correct":"from humanfriendly.prompts import prompt_for_input"}],"quickstart":{"code":"import os\nfrom humanfriendly import format_size, parse_size\n\ndef process_size(size_str: str) -> str:\n    try:\n        num_bytes = parse_size(size_str)\n        return f\"You entered: {format_size(num_bytes)}\"\n    except Exception as e:\n        return f\"Error parsing size: {e}\"\n\n# Example usage (usually from user input or a configuration)\nuser_input = os.environ.get('EXAMPLE_FILE_SIZE', '10GB') # Simulate input\nprint(process_size(user_input))\n","lang":"python","description":"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`."},"warnings":[{"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.","message":"The `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.","severity":"deprecated","affected_versions":"10.0.1.20250319 and later (effectively frozen)"},{"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.","message":"Stub 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.","severity":"gotcha","affected_versions":"All versions, especially when paired with `humanfriendly` versions > 10.0"},{"fix":"Test `humanfriendly` thoroughly with your target Python version. If you encounter runtime issues, consider alternative libraries with active maintenance.","message":"The 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.","severity":"gotcha","affected_versions":"humanfriendly==10.0 with Python 3.13+"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}