Skip to main content

Tie docs to the code they describe, and yell when one moves without the other. Plugs into any repo.

Project description

documate generating a repository's docs and gating them from the terminal

documate

documate generates documentation from your code (an overview, one page per module, and an API reference from your docstrings) and fails CI when those docs stop matching the code.

python license docs

Install

uv tool install documate     # or: pipx install documate  /  pip install documate

--ai additionally needs the claude CLI on your PATH. Everything else is stdlib.

Use

cd your-repo
documate --init    # first run: create a config, then generate the docs
documate           # generate or refresh docs/, then gate them
Command What it does
documate index, write or refresh docs/, then gate it
documate --check gate only, writes nothing (for CI and pre-commit)
documate --watch regenerate on every save
documate --html also render a static site into site/
documate --ai [MODEL] draft missing docstrings with a model, then re-verify
documate --stats show coverage, documentation lines, and model spend

Run documate path/to/repo to document any repo. Run documate --help for the full list.

What it writes

  • docs/README.md: an overview with a dependency map, coverage, entry points, and hotspots.
  • docs/ARCHITECTURE.md: the whole system on one page.
  • docs/architecture/<module>.md: one page per module (docstring, dependencies, call-flow, symbols).

The gate

documate --check exits non-zero when:

  1. Generated pages are out of date. Run documate to refresh them.
  2. A hand-written page points at code that no longer exists.
  3. A hand-written page describes code that changed since --base but was not updated.

Install the pre-commit hook once:

git config core.hooksPath hooks

It regenerates and stages the generated pages on every commit. In CI, run documate --check with fetch-depth: 0 on actions/checkout.

Authored pages

Write Markdown under docs/ and anchor it to the code it documents:

<!-- documents: sym:build_model -->

documate --check then fails if that code changes and the page does not. Add a sig: fingerprint after the symbol to pin the page to the exact source.

Configuration

documate --init writes documate.config.json. Override only what you need:

{
  "docs_dir": "docs",
  "site_dir": "site",
  "skip_dirs": ["/generated/"],
  "default_base": "main"
}

License

MIT. The engine in src/documate/_engine/ is vendored from code-review-graph (MIT).

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

documate-0.2.2.tar.gz (276.3 kB view details)

Uploaded Source

Built Distribution

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

documate-0.2.2-py3-none-any.whl (212.8 kB view details)

Uploaded Python 3

File details

Details for the file documate-0.2.2.tar.gz.

File metadata

  • Download URL: documate-0.2.2.tar.gz
  • Upload date:
  • Size: 276.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for documate-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8e391adc939b577417dbc84a22dceea6eb3c6bff809dc4a9f5e4477c33ae8fef
MD5 7c2cd753a55f47d65b03aab54cfa783b
BLAKE2b-256 8d08716c5b0822e264a6b8790d8f097dcd3bb4a7bf185219470fc3cc9943bdd3

See more details on using hashes here.

File details

Details for the file documate-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: documate-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 212.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for documate-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4111436b401808af8531f3aeb84ff8bff1148a8ae0df4b98eedb9e64b5ad60
MD5 7140f4b6777e8e11a94bc33d0614a7d0
BLAKE2b-256 3a552a8e4d053c2e9c0ab10c2975430a1c872ff6af75349c12059d63188079df

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