Self-hosted code quality and security platform that scans projects for bugs, vulnerabilities and maintainability issues, with Quality Gates for CI pipelines.
econchick/interrogate
A Python CLI that measures how many functions, classes, methods and modules in a codebase have docstrings, with CI-friendly pass/fail thresholds.
- Stars
- 678
- Forks
- 58
- Open issues
- 42
- Last commit
- 4 days ago
What is it?
interrogate scans Python source code and reports which modules, classes, methods and functions have docstrings and which do not. It gives a coverage percentage at the project, file or object level, so teams can see how well their code is documented and where the gaps are.
The tool is built for enforcement as well as reporting. It exits with a failure status when coverage falls below a set threshold (default 80%, configurable with --fail-under), which makes it easy to add to CI pipelines or pre-commit hooks so that newly added code must be documented. Output can be a summary table, a per-object detailed view, or a quiet mode for scripts.
Behavior is configurable through pyproject.toml or setup.cfg. Users can ignore categories such as __init__ methods, magic methods, private or nested objects, setters, or @overload functions, exclude paths, and filter names with regular expressions. It also supports Sphinx and Google docstring styles and can generate a shields.io-style coverage badge in SVG or PNG format. Python 3.8 and above are supported.
Key features
- 01Reports docstring coverage for modules, classes, methods and functions.
- 02Fails the run when coverage is below a configurable threshold, for CI use.
- 03Offers summary, detailed and quiet output modes.
- 04Ignores selected object types such as magic methods, private or nested objects.
- 05Supports Sphinx and Google docstring styles.
- 06Generates shields.io-style coverage badges in SVG or PNG.
Use cases
- Enforcing docstrings on new code through a CI job or pre-commit hook.
- Assessing how well-documented an unfamiliar Python codebase is.
- Displaying a documentation coverage badge in a project README.
- Tracking documentation gaps file by file during a cleanup effort.
Quick start
- 1
Install interrogate from PyPI with pip
pip install interrogate - 2
Run interrogate on a Python project path to check docstring coverage
interrogate [PATH]
Things to know
- Only measures whether docstrings exist, not their quality.
- Generating PNG badges requires extra system libraries such as cairo.
In collections
Topics
FAQ
- What is interrogate?
- A Python CLI that measures how many functions, classes, methods and modules in a codebase have docstrings, with CI-friendly pass/fail thresholds. interrogate scans Python source code and reports which modules, classes, methods and functions have docstrings and which do not. It gives a coverage percentage at the project, file or object level, so teams can see how well their code is documented and where the gaps are.
- Is interrogate free to use? What license does it have?
- interrogate is open source under the MIT license. Check the license terms before using it in commercial products.
- Is interrogate still maintained?
- Actively maintained. The last commit to interrogate was on Nov 2, 2026.
- What can I use interrogate for?
- Enforcing docstrings on new code through a CI job or pre-commit hook. Assessing how well-documented an unfamiliar Python codebase is. Displaying a documentation coverage badge in a project README. Tracking documentation gaps file by file during a cleanup effort.
- How do I install interrogate?
- Install interrogate from PyPI with pip: pip install interrogate Run interrogate on a Python project path to check docstring coverage: interrogate [PATH]
- Where can I get interrogate?
- The source code and installation instructions are on GitHub: https://github.com/econchick/interrogate
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A linter that enforces Swift style and conventions, with over 200 rules that can be configured per project.
A Python command-line tool that automatically reformats docstrings to follow PEP 257 conventions.
Mutation testing for Ruby that modifies your code and reports which changes your test suite fails to catch.
A command-line prose linter that enforces your team's writing style rules in editors, CI, and code, running offline.
A local, deterministic duplicate-code detector that finds functions copied by AI agents even after identifiers are renamed.