doc8
Style checker for Sphinx (or other) RST documentation
What it is and what it does
doc8 is a command-line and programmatic style checker for reStructuredText documentation. It enforces a set of opinionated formatting rules including line length limits (default 79 characters), trailing whitespace removal, proper indentation without tabs, Unix newlines, and valid RST syntax. The tool can be run directly against documentation directories or integrated into Python projects via its API.
The package depends on docutils for RST parsing, restructuredtext-lint for linting checks, stevedore for plugin management, tomli for TOML configuration parsing, and Pygments for syntax highlighting. It supports configuration via command-line arguments or INI-style files (doc8.ini, setup.cfg, tox.ini, pyproject.toml) and allows selective error ignoring and path exclusion. Results are returned as structured error tuples or human-readable reports.
Use it for:
- Enforce consistent RST formatting in Sphinx-based documentation projects as part of CI/CD pipelines.
- Validate documentation style in multi-contributor projects to catch formatting issues before merge.
- Check documentation compliance in automated quality gates alongside code linting tools.
- Scan existing documentation repositories for style violations and generate reports for remediation.
- Programmatically validate RST files in documentation generation workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
doc8 is a style checker for reStructuredText documentation that validates formatting rules like line length, trailing whitespace, indentation, and newline conventions.
Yes. doc8 is actively maintained, has no known vulnerabilities, installs with low friction, and is widely used (top 5000 PyPI packages). It fills a clear niche in RST documentation quality assurance. Install it if you maintain Sphinx or reStructuredText documentation and want automated style enforcement.
Install
doc8 on PyPI
pip
pip install doc8uv
uv add doc8poetry
poetry add doc8Installing doc8
Before you install
Low install friction with a pure Python wheel distribution. Actively maintained with recent commits and a stable production status across Python 3.10 through 3.14.
License in practice
Apache-2.0 permissive license allows use in most projects, including commercial, with minimal restrictions beyond attribution.
Quickstart
pip install doc8
from doc8 import doc8
result = doc8(max_line_length=99)
print(result.report())
Requires Python 3.10 or later.
Verify before relying
- Whether the package handles Markdown or other markup formats beyond RST and plain text.
- Performance characteristics when scanning large documentation trees.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — docutils, restructuredtext-lint, stevedore, tomli, Pygments |
| Maintenance | actively maintained — 427 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 902,421/month — #4,770 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: doc8-2.0.0-py3-none-any.whl
Keywords: doc8, rst, linter
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
sphinx-lintSphinx Lint checks reStructuredText and Python…
permissive · top 15,000 on PyPI
rstcheckValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
docstrfmtAutomatically formats reStructuredText in files…
permissive · top 15,000 on PyPI
restructuredtext-lintLints reStructuredText documents for structural…
permissive · top 5,000 on PyPI
rstcheck-coreValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
sphinx_mdincludeSphinx extension that lets you include and…
permissive · top 15,000 on PyPI
flake8-rst-docstringsA flake8 plugin that validates Python…
permissive · top 15,000 on PyPI
autopep8autopep8 automatically reformats Python code to…
permissive · top 5,000 on PyPI
collective.checkdocsAdds distutils commands to validate and preview…
copyleft · top 15,000 on PyPI
bashatebashate is a style checker for bash scripts…
permissive · top 15,000 on PyPI