Skip to main content

Docstr-Health

Docstr-Health

PyPI version Python versions License Downloads GitHub stars

docstr-health is a rich-powered CLI health score and visualization tool for Python docstrings.

Analyze the quality of any Python project's documentation — locally, from Git, or PyPI packages.

Preview

Preview

Table of Contents


Features

  • Local & remote scanning — works on local directories, Git repositories, and PyPI packages
  • Docstring quality grading — each function gets a status: good, special, epic, bad
  • Rich terminal UI — color-coded output with panels, tables, and progress bars
  • Configurable rules — customize symbols, colors, and keyword requirements via config.toml
  • Module-level statistics — per-module breakdown with overall project summary
  • PEP 257 awareness — checks for Args, Returns, Raises, and other standard sections
  • Async support — properly distinguishes sync/async functions
  • Cache & no-cache modes — clone remote repos once or scan fresh every time

How It Compares

Feature docstr-health pydoclint darglint / darglint2 interrogate docstr_coverage
Scope Docstring quality grading Docstring correctness vs signature Docstring correctness vs signature Docstring coverage (%) Docstring coverage (%)
Quality levels ✅ bad → good → special → epic ❌ Pass/fail only ❌ Pass/fail only ❌ Percentage only ❌ Percentage only
Rich terminal UI ✅ Rich panels, colors, symbols ❌ Plain text ❌ Plain text ❌ ASCII table ❌ Plain text
Remote scanning (Git / PyPI) ✅ Built-in ❌ ❌ ❌ ❌
Configurable rules ✅ config.toml (symbols, colors, keywords) ✅ CLI flags + config ✅ .darglint config ✅ pyproject.toml / setup.cfg ✅ .docstr.yaml
Pre-commit hook ❌ Planned ✅ ✅ ✅ ✅
Performance ✅ Fast (AST-based) ⚡ Very fast ❌ Slow (CYK parser) ✅ Fast ✅ Fast
Docstring styles ✅ Google, Sphinx, NumPy ✅ Google, Sphinx, NumPy ✅ Google, Sphinx, NumPy ❌ Coverage only ❌ Coverage only
Signature validation ❌ Planned ✅ Checks args/returns/raises match code ✅ Checks args/returns/raises match code ❌ ❌
Coverage badge generation ❌ Planned ❌ ❌ ✅ SVG/PNG ✅ SVG

When to use docstr-health

  • You want a quick visual health score for your project's documentation
  • You need to scan remote repositories (Git, PyPI) without cloning manually
  • You want color-coded terminal output with rich formatting
  • You want to distinguish between "has a docstring" (good), "has parameter docs" (special), and "has full docs with returns/raises" (epic)

Installation

Using uv

uv pip install docstr-health

Using pip

pip install docstr-health

From source

git clone https://github.com/PurpleSwtr/docstr-health.git
cd docstr-health
uv venv
uv pip install .

Usage

Scan a local project

docstr-health /path/to/project

If no path is given, the current directory is used.

Scan a Git repository

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

The repository is cloned into a cache directory and scanned automatically.

Scan a PyPI package

docstr-health --pypi-package requests

Downloads and scans the package from PyPI.

Compact mode

Display only the summary statistics without the per-function listing:

docstr-health --compact

Include module docstrings

Include __doc__ of the modules themselves in the analysis:

docstr-health --doc-modules

All flags

Flag Description
--repo-url Scan a remote Git repository
--pypi-package Scan a remote PyPI package
--cache-dir Custom cache directory for remote repos
--no-cache Do not cache remote repositories
--compact Show only summary statistics
--doc-modules Include module __doc__ strings
--ignore-tests Skip test files and directories
--version Show version and exit

Output

Docstring statuses

Status Symbol Meaning
bad ✗ Missing or empty docstring
good ✓ Docstring exists but only has a description
special ★ Contains parameter docs (Args:,:param, Returns:, etc.)
epic ♥ Contains advanced sections (Raises:, Examples:)

Module statuses

The overall module status is computed from the individual function statuses:

  • bad — all or most functions are undocumented
  • warning — some functions are undocumented
  • good — all functions documented, few special sections
  • special — >50% of functions have parameter documentation
  • epic — >50% of functions have advanced documentation (returns, raises, examples)

Configuration

Customize the behavior by editing config.toml inside the package, or fork the defaults.

Available options in [user_parameters]:

debug = false                  # Enable verbose logging
use_uv = true                  # Use uv instead of pip for PyPI downloads
excluded = [".venv", "__init__", "__pycache__"]
excluded_functions = ["wrapper"]

# Customize display symbols and colors
common_symbol = "●"
bad_symbol = "✗"
warning_symbol = "⚠"
good_symbol = "✔"
special_symbol = "★"
epic_symbol = "♥"
skipped_symbol ="…"

common_color = "white"
bad_color = "red"
warning_color = "dark_orange"
good_color = "green"
special_color = "yellow"
epic_color = "purple"
skipped_color ="gray"

Docstring requirement levels define which keywords trigger a special or epic status. By default requires_v4 is used.


Development

git clone https://github.com/PurpleSwtr/docstr-health.git
cd docstr-health
uv venv
uv sync --group dev
uv run docstr-health .

Run tests:

uv run pytest

Contributing

We welcome and appreciate all contributions!

Before you begin, please read Contributing Guide. It covers coding standards, branching strategy, and the Pull Request process.

License

Apache License 2.0 © Mihail Sergeenko. See LICENSE for details.

Acknowledgements

Built using just one library: Rich

Metadata

Release files for docstr-health 0.1.4

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

Source distribution (sdist)

Source distribution for docstr-health 0.1.4
File Size Uploaded
docstr_health-0.1.4.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docstr-health 0.1.4
File Interpreter ABI Platform
docstr_health-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 43.1 kB

Release files / docstr_health-0.1.4.tar.gz

Download URL docstr_health-0.1.4.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
867ba4b5ce6dfa820158426c5c40fa9d2b968cc5214dd3ab60a89c1eacba4969
BLAKE2b-256 checksum
How to use checksums
898d1ff568c5038ac7844df6c9691f569b27f55f2030314a74ca263518ac3f1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release files / docstr_health-0.1.4-py3-none-any.whl

Download URL docstr_health-0.1.4-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
296a98f146a505931b4cc703fd6a426ab33381b11eca8a0267e2fa93648469d4
BLAKE2b-256 checksum
How to use checksums
a83194a72abb0562747249abcdaa2aaa63ee7e09f20f6c7a43472173f490a105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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