--- id: attributes-doc version: "0.4.0" license: MIT license_treatment: permissive maintenance: dormant --- # attributes-doc — PEP 224 implementation License: permissive · Maintenance: dormant · Downloads: 439.4K/mo ## What it is and what it does attributes-doc provides a decorator and utility functions to capture and store docstrings written immediately after class attributes, making them accessible at runtime as special attributes or via helper functions. It implements PEP 224, which proposed a syntax for documenting individual class members. The package works by scanning a class definition, extracting docstrings that follow attribute assignments, and storing them either as `__doc_ATTRNAME__` attributes on the class or in a dictionary returned by a query function. The package offers four main entry points: a `@attributes_doc` decorator for regular classes, a `get_attributes_doc()` function to extract docs without modifying a class, an `@enum_doc` decorator for Enum classes that attaches docs to individual enum members, and a `get_doc()` helper to retrieve a single attribute's docstring. It has no runtime dependencies and supports Python 3.8 through 3.12. Use it for: - Generate API documentation or help text from class attribute docstrings at runtime - Build introspectable data models where each field carries its own documentation - Decorate Enum classes to attach descriptions to each enum value for user-facing displays - Extract attribute metadata for validation, serialization, or schema generation tools ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts and stores docstrings for class attributes at runtime, implementing PEP 224 to make attribute documentation programmatically accessible via decorator or function call. Yes, if you need to attach and retrieve docstrings for class attributes at runtime. The package is lightweight, has no dependencies, and works on current Python versions. The dormant maintenance status is a minor concern for a small, stable utility—suitable for projects that don't require active development, but verify it fits your documentation workflow before adopting. ## Install pip install attributes-doc uv add attributes-doc poetry add attributes-doc ## Installing attributes-doc Before you install: Low install friction with no runtime dependencies. Dormant maintenance since January 2024 (948 days), though the repository remains active and supports current Python versions (3.8–3.12). License in practice: MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open and closed projects. Quickstart: pip install attributes-doc from attributes_doc import attributes_doc @attributes_doc class Foo: bar = 1 """Docstring for bar.""" print(Foo.__doc_bar__) Verify before relying: - Whether the package is actively maintained or accepting contributions despite dormant status - Real-world adoption rate beyond the 439416 monthly downloads figure ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 439.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags attribute docstrings runtime, PEP 224 implementation, class attribute documentation, extract attribute docs, enum member docstrings, attribute metadata decorator, documentation, introspection, metadata [View on SkillFed](https://skillfed.io/packages/attributes-doc) · [View on PyPI](https://pypi.org/project/attributes-doc/)