Docstring generation from annotations with configurable output formats.
Project description
📝 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 📦
Method: Install Python Package
Install via uv pip command:
uv pip install dynadoc
Or, install 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__ )
Contribution 🤝
Contribution to this project is welcome! However, it must follow the code of conduct for the project.
Please file bug reports and feature requests in the issue tracker or submit pull requests to improve the source code or documentation.
For development guidance and standards, please see the development guide.
More Flair
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dynadoc-1.4.tar.gz.
File metadata
- Download URL: dynadoc-1.4.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbfd5fd65e0b52dbbf7706b13b12a56a60185b919160ae5a461e7624ef6a9489
|
|
| MD5 |
945b8699ab79d75c652fc5d9f3f900b3
|
|
| BLAKE2b-256 |
0cfe2cb26453c6a50c1303f50ab1a6e5cc9c06b14bf0b3aa1914f6c5c21331bd
|
Provenance
The following attestation bundles were made for dynadoc-1.4.tar.gz:
Publisher:
releaser.yaml on emcd/python-dynadoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dynadoc-1.4.tar.gz -
Subject digest:
dbfd5fd65e0b52dbbf7706b13b12a56a60185b919160ae5a461e7624ef6a9489 - Sigstore transparency entry: 323058627
- Sigstore integration time:
-
Permalink:
emcd/python-dynadoc@c51d13d9a699aef4e31b18b3446f9a0f3e8d3fd2 -
Branch / Tag:
refs/tags/v1.4 - Owner: https://github.com/emcd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
releaser.yaml@c51d13d9a699aef4e31b18b3446f9a0f3e8d3fd2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dynadoc-1.4-py3-none-any.whl.
File metadata
- Download URL: dynadoc-1.4-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f2a692ad97ddbc48183667c493f923d3328d06e4894793770bfc09c5130fff
|
|
| MD5 |
f5a01bc5abe4492a0238e8e616d24a5f
|
|
| BLAKE2b-256 |
eeef38b621893e9bf3e8a755593a7a84f0d12a4a16de8f45adb62f4e95d66923
|
Provenance
The following attestation bundles were made for dynadoc-1.4-py3-none-any.whl:
Publisher:
releaser.yaml on emcd/python-dynadoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dynadoc-1.4-py3-none-any.whl -
Subject digest:
26f2a692ad97ddbc48183667c493f923d3328d06e4894793770bfc09c5130fff - Sigstore transparency entry: 323058654
- Sigstore integration time:
-
Permalink:
emcd/python-dynadoc@c51d13d9a699aef4e31b18b3446f9a0f3e8d3fd2 -
Branch / Tag:
refs/tags/v1.4 - Owner: https://github.com/emcd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
releaser.yaml@c51d13d9a699aef4e31b18b3446f9a0f3e8d3fd2 -
Trigger Event:
push
-
Statement type: