{"id":382,"library":"annotated-doc","title":"Annotated Doc","description":"A Python library that enables inline documentation of parameters, class attributes, return types, and variables using the `Annotated` type hint. Current version: 0.0.4. Release cadence: irregular, with the latest release on November 10, 2025.","status":"active","version":"0.0.4","language":"python","source_language":"en","source_url":"https://github.com/fastapi/annotated-doc","tags":["documentation","type hints","Python 3.8+"],"install":[{"cmd":"pip install annotated-doc","lang":"bash","label":"Install annotated-doc"}],"dependencies":[{"reason":"Provides support for the `Annotated` type hint in Python versions prior to 3.9","package":"typing-extensions","optional":true}],"imports":[{"note":"Ensure correct import path to access the `Doc` class","symbol":"Doc","correct":"from annotated_doc import Doc"}],"quickstart":{"code":"from typing import Annotated\nfrom annotated_doc import Doc\n\ndef greet(name: Annotated[str, Doc('The name of the person to greet')]) -> None:\n    print(f'Hello, {name}!')\n\ngreet('Alice')","lang":"python","description":"A simple function demonstrating the use of `Doc` for inline documentation"},"warnings":[{"fix":"Use `from annotated_doc import Doc` to correctly import the `Doc` class.","message":"The `Doc` class is located in the `annotated_doc` module, not `annotated-doc` as the package name might suggest.","severity":"breaking","affected_versions":"0.0.4"},{"fix":"Ensure that `Doc` is used within type annotations to document parameters, class attributes, return types, and variables.","message":"The `Doc` class is intended for inline documentation and should be used within type annotations.","severity":"gotcha","affected_versions":"0.0.4"}],"env_vars":null,"last_verified":"2026-05-12T13:26:22.364Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the package using 'pip install annotated-doc'.","cause":"The 'annotated-doc' package is not installed or is installed under a different name.","error":"ModuleNotFoundError: No module named 'annotated_doc'"},{"fix":"Upgrade to Python 3.9 or later, or install the 'typing-extensions' package and import 'Annotated' from it.","cause":"The 'Annotated' type hint is not available in Python versions earlier than 3.9.","error":"ImportError: cannot import name 'Annotated' from 'typing'"},{"fix":"Ensure the correct import statement: 'from annotated_doc import Doc'.","cause":"The 'Doc' class is not found in the 'annotated_doc' module, possibly due to an incorrect import statement.","error":"ImportError: cannot import name 'Doc' from 'annotated_doc'"},{"fix":"For Python versions prior to 3.9, use generic types imported from the `typing` module (e.g., `from typing import List`, then `Annotated[List[int], Doc(...)]`). For Python 3.9 and later, `list[int]` is valid.","cause":"This error typically arises when attempting to use built-in types (e.g., `list`, `dict`) directly as generic types (e.g., `list[int]`) in Python versions prior to 3.9. In such versions, generic types must be imported from the `typing` module (e.g., `typing.List[int]`). Since `annotated-doc` uses `Annotated[Type, Doc(...)]`, an incorrectly subscripted `Type` within `Annotated` for older Python versions will trigger this error.","error":"TypeError: 'type' object is not subscriptable"}],"ecosystem":"pypi","meta_description":null,"install_score":80,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"17.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"19.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"11.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"11.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"17.3M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"18M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}