{"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,"search_vec":"'0.0.4':25 '10':35 '2025':36 '3.8':41 'annot':1,20 'attribut':13 'cadenc':27 'class':12 'current':23 'doc':2 'document':9,37 'enabl':7 'hint':22,39 'inlin':8 'irregular':28 'latest':31 'librari':5 'novemb':34 'paramet':11 'python':4,40 'releas':26,32 'return':14 'type':15,21,38 'use':18 'variabl':17 'version':24","created_at":"2026-03-28T11:14:13.635322+00:00","updated_at":"2026-04-15T20:10:43.800492+00:00","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,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"0.0.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/fastapi/annotated-doc","docs":"https://github.com/fastapi/annotated-doc","changelog":"https://github.com/fastapi/annotated-doc/release-notes.md","pypi":"https://pypi.org/project/annotated-doc/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":"verified"}}