Language-agnostic YAML docstrings for Python.
Douki is a developer tool that uses a structured YAML format inside Python docstrings. It keeps your docstrings in sync with your function signatures and validates them against a schema — all without adding a runtime dependency to your package.
- Structured — docstrings are YAML, not free-form text. Parameters have
type,description,optional, anddefaultfields. - Auto-synced —
douki syncadds new parameters, removes stale ones, and updates return types automatically. - Validated — every docstring is checked against a JSON Schema so typos and invalid fields are caught early.
- Dev-only — Douki is a development tool. It does not need to be a runtime dependency of your package.
- Migratable — convert existing NumPy-style docstrings with
douki migrate numpydoc.
Install Douki as a dev dependency:
pip install doukiWrite a docstring in Douki YAML format:
def add(a: int, b: int = 0) -> int:
"""
title: Add two integers
parameters:
a:
type: int
description: First value.
b:
type: int
description: Second value.
default: 0
returns:
type: int
description: Sum of a and b.
"""
return a + bSync your docstrings with the actual signatures:
# Preview changes
douki check src/
# Apply changes in-place
douki sync src/- Installation — install via pip, conda, or from source
- Usage Guide — CLI commands, YAML schema, and migration
- Changelog — release history
- Contributing — how to contribute