dynadocยถ

Package Version PyPI - Status Tests Status Code Coverage Percentage Project License Python Versions

๐Ÿ“ A Python library package which bridges the gap between rich annotations and automatic documentation generation with configurable renderers and support for reusable fragments.

Key Features โญยถ

  • ๐Ÿ”„ Docstring Generation: Generation of docstrings for modules, classes, functions, and methods via introspection with fine-grained control.

  • ๐Ÿงฉ Fragment System: Reusable documentation snippets for consistent terminology across projects.

  • ๐Ÿท๏ธ Annotation Metadata: Extraction and inclusion of metadata from annotations into generated docstrings.

  • ๐Ÿ”Œ Extensible Architecture: Custom renderers, attribute visibility rules, and introspection limiters.

  • ๐Ÿ“– Sphinx-Compatible Output: Render reStructuredText docstrings that work with Sphinx Autodoc out of the box.

  • ๐ŸŽจ Configurable Renderers: Ability to extend with other renderers as desired.

Installation ๐Ÿ“ฆยถ

Via uv pip command:

uv pip install dynadoc

Or, via pip:

pip install dynadoc

Examples ๐Ÿ’กยถ

Please see the examples directory.

Function Documentation:

import dynadoc
from typing import Annotated

@dynadoc.with_docstring( )
def process_api_data(
    endpoint: Annotated[ str, dynadoc.Doc( "API endpoint URL to query" ) ],
    timeout: Annotated[ float, dynadoc.Doc( "Request timeout in seconds" ) ] = 30.0,
) -> Annotated[ dict, dynadoc.Doc( "Processed API response data" ) ]:
    ''' Process data from API endpoint with configurable timeout. '''
    return { }

Which will be turned into the following docstring on the function by the default renderer:

Process data from API endpoint with configurable timeout.

:argument endpoint: API endpoint URL to query
:type endpoint: str
:argument timeout: Request timeout in seconds
:type timeout: float
:returns: Processed API response data
:rtype: dict

Module Documentation:

Document all annotated attributes in current module:

import dynadoc

dynadoc.assign_module_docstring( __name__ )

More Flairยถ

GitHub last commit Copier Hatch pre-commit Pyright Ruff PyPI - Implementation PyPI - Wheel

Other Projects by This Author ๐ŸŒŸยถ

  • python-absence

    ๐Ÿ•ณ๏ธ A Python library package which provides a sentinel for absent values - a falsey, immutable singleton that represents the absence of a value in contexts where None or False may be valid values.

  • python-accretive

    ๐ŸŒŒ A Python library package which provides accretive data structures - collections which can grow but never shrink.

  • python-falsifier

    ๐ŸŽญ A very simple Python library package which provides a base class for falsey objects - objects that evaluate to False in boolean contexts.

  • python-frigid

    ๐Ÿ”’ A Python library package which provides immutable data structures - collections which cannot be modified after creation.

  • python-icecream-truck

    ๐Ÿฆ Flavorful Debugging - A Python library which enhances the powerful and well-known icecream package with flavored traces, configuration hierarchies, customized outputs, ready-made recipes, and more.

  • python-mimeogram

    ๐Ÿ“จ A command-line tool for exchanging collections of files with Large Language Models - bundle multiple files into a single clipboard-ready document while preserving directory structure and metadataโ€ฆ good for code reviews, project sharing, and LLM interactions.

Table of Contentsยถ

Indicesยถ