Skip to main content

Documetatio from annotations

Project description

Douki

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.

Why Douki?

  • Structured — docstrings are YAML, not free-form text. Parameters have type, description, optional, and default fields.
  • Auto-synceddouki sync adds 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.

Quick Start

Install Douki as a dev dependency:

pip install douki

Write 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 + b

Sync your docstrings with the actual signatures:

# Preview changes
douki check src/

# Apply changes in-place
douki sync src/

By default, Douki respects .gitignore during file discovery. You can disable that per run with --no-respect-gitignore, or set [tool.douki] respect-gitignore = false in pyproject.toml.

What's Next?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

douki-0.12.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

douki-0.12.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file douki-0.12.0.tar.gz.

File metadata

  • Download URL: douki-0.12.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Linux/6.14.0-1017-azure

File hashes

Hashes for douki-0.12.0.tar.gz
Algorithm Hash digest
SHA256 e2e15f4aa328295471c01dad02829fccd744d6b7c74dc3bef8d58e611dc45182
MD5 8a484c54d8be94d92be538f302cc8fd8
BLAKE2b-256 8cd263291e6a9e3cd7e95e200a69fb0fbca7aec3042f6b55fbe613417264fc25

See more details on using hashes here.

File details

Details for the file douki-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: douki-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Linux/6.14.0-1017-azure

File hashes

Hashes for douki-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e93fc7d14186c3c6f92add490f8287be4f95d201d8d24815dd1fe05b247dcaee
MD5 dc9872dfe235d4a9e12f9b4d83f2adf8
BLAKE2b-256 1826e563aa1269967fd75701024cfb3b4a826d0692f1695d9f6b5accbf94f329

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page