Skip to main content

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for douki 0.14.0
File Size Uploaded Provenance Actions
douki-0.14.0.tar.gz 40.5 kB Without provenance Details for douki-0.14.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for douki 0.14.0
File Interpreter ABI Platform Actions
douki-0.14.0-py3-none-any.whl Python 3 none any Details for douki-0.14.0-py3-none-any.whl

Total release size: 90.0 kB

Release files / douki-0.14.0.tar.gz

Download URL douki-0.14.0.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6245a321dd48ef04f947d073b1ea3bd1e4bb05a06a8a078c57c81d366fe66623
BLAKE2b-256 checksum
How to use checksums
bbf58444b2a6b18562e9fa3582369397507f92899d8e069b7dbc737b2a6327e8
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-1019-azure

Release files / douki-0.14.0-py3-none-any.whl

Download URL douki-0.14.0-py3-none-any.whl
Size 49.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
617012a5fc14cdce49b469a36cb548920cd9fcc2a1d64dd79783dd6011916268
BLAKE2b-256 checksum
How to use checksums
bb9726a2e90c7be8aeba71804af2f2c6e0e061767e01419f274c3fa7b5c9c2ef
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-1019-azure

Security for douki 0.14.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page