Skip to content

Basic Usage

docstr-health accepts a single positional argument — the path to the directory you want to analyze. When omitted, the current working directory is used.

docstr-health [PATH] [OPTIONS]

Scanning modes

Local directory

docstr-health /path/to/project

The directory is scanned recursively for *.py files.

Remote Git repository

docstr-health --repo-url https://github.com/user/repo.git

The repository is cloned (depth 1) into the cache directory and scanned. Use --cache-dir to change the location, or --no-cache to always fetch a fresh copy and remove it afterwards.

PyPI package

docstr-health --pypi-package requests

The package is downloaded into the cache directory. Downloads use uv when available and fall back to pip otherwise.

How scanning works

  1. All *.py files under the target directory are collected, honoring the exclusion rules.
  2. Each file is parsed into an AST (type comments are skipped for speed).
  3. Every function, method, and class is inspected and graded by its docstring.
  4. Module-level and project-level statistics are computed and displayed.

Functions and classes with dunder names (__init__, __call__, …) and names listed in excluded_functions are skipped by default.

Excluding files

By default docstr-health skips these directories:

.venv  venv  __init__  __pycache__

Add your own patterns via config.toml or [tool.docstr-health] in pyproject.toml.

Next steps