Douki
YAML docstrings with types supplied by annotations.
Write descriptions in your docstrings and types in Python annotations. Douki enriches documentation when you inspect it, while its CLI validates and formats the YAML in your source files.
def add(a: int, b: int = 0) -> int:
"""
title: Add two integers.
parameters:
a: First value.
b: Second value.
returns: Sum of a and b.
"""
return a + b
Inspect documentation
Register the library once in its __init__.py:
# mylib/__init__.py
import douki
douki.register(__name__)
Users then call ordinary Python help:
import mylib
help(mylib.add) # Douki descriptions enriched with annotation types
help(len) # Regular Python help
Registration covers the package and its submodules, including future imports.
Objects defined in other libraries retain regular help, even when re-exported
by your package. No per-function decorators or user activation calls are needed.
The shared help wrapper routes by defining package; importing Douki alone does
not install it. Original __doc__ strings remain authored text.
Tools can call douki.getdoc(add) directly without registration to obtain
enriched YAML. Documentation generators can also use the static enrichment API.
Synchronize, format and validate source
pip install douki
douki sync src/ # Add missing descriptions
douki format src/ # Normalize YAML formatting
douki format --check src/ # Preview formatting differences
douki check src/ # Validate documentation
check and sync require annotations for parameters, return values and
documented attributes. Use -> None for functions without a result;
implicit method receivers are exempt. Authored type fields are rejected
by the schema. Remove only those fields from existing docstrings and put
types in annotations instead. Keep parameters, returns and attributes
with their descriptions: annotations supply types, not explanations.
sync adds missing parameter, attribute and return entries with ...
placeholders, without storing types. It preserves existing descriptions
and reports stale parameter names. format only changes presentation;
check reports missing or incomplete descriptions.
Dynamic inspection raises DocumentationError for missing annotations.
The CLI can remain a development dependency. Install Douki in the running
interpreter when using getdoc, help or library registration.
Documentation generators can use the public enrich, Signature and
Parameter API with statically collected types, without importing the
project being documented. See the usage guide.
Douki respects .gitignore by default. Override it with
--no-respect-gitignore or [tool.douki] respect-gitignore = false.
Metadata
Release files for douki 0.14.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| douki-0.14.1.tar.gz | 40.6 kB | Without provenance | Details for douki-0.14.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| douki-0.14.1-py3-none-any.whl | Python 3 | none | any | Details for douki-0.14.1-py3-none-any.whl |
Total release size: 90.1 kB
Release files / douki-0.14.1.tar.gz
| Download URL | douki-0.14.1.tar.gz |
|---|---|
| Size | 40.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43e2a7f045bf64d76719e380d92b2a28db426216f8fc4173a728635c0f026380
|
|
BLAKE2b-256 checksum How to use checksums |
a67bf52b456949ed67e8a6f1a017f159b051af5aad32c842f0057f813f495864
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.13.18 Linux/7.0.0-1020-azure
|
Release files / douki-0.14.1-py3-none-any.whl
| Download URL | douki-0.14.1-py3-none-any.whl |
|---|---|
| Size | 49.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1012edc9f89a63866e7ef2b7aa11b6e2308c3f882a7f0aebc8149cead122743f
|
|
BLAKE2b-256 checksum How to use checksums |
20db5183daed6d245c3d17b52d062953787ac927e3970fb15249ce39d680f986
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.13.18 Linux/7.0.0-1020-azure
|
Security for douki 0.14.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.