restructuredtext-lint
reStructuredText linter
What it is and what it does
restructuredtext-lint checks reStructuredText files for structural violations before they are uploaded to PyPI or deployed. It wraps docutils parsing and exposes both a Python API (lint() and lint_file() functions) and a command-line tool (rst-lint) that report errors with line numbers, severity levels, and descriptive messages. Each error includes metadata like source file, error type (INFO/WARNING/ERROR/SEVERE), and the full context where the problem occurred.
The package was created to catch reST formatting issues locally rather than discovering them after publishing. It supports prepending content via rst_prolog for testing with substitutions, filtering by error severity, and output in text or JSON format. Custom directives and roles can be registered via docutils' extension mechanism, though Sphinx-specific customizations require manual registration due to parser differences.
Use it for:
- Validate README.rst and other documentation files before pushing to PyPI or a repository
- Integrate linting into CI/CD pipelines to catch reStructuredText errors early
- Check documentation consistency in projects using Sphinx or docutils
- Programmatically lint reST content in build scripts or documentation generators
- Detect title underlines, hyperlink issues, and lexer problems that would fail on PyPI
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Lints reStructuredText documents for structural errors and returns a list of violations with line numbers, severity levels, and messages.
Yes, if you work with reStructuredText documentation or publish to PyPI. The tool solves a real problem—catching formatting errors before upload—with low install friction and no security vulnerabilities. The aging maintenance status (264 days since release) is a minor concern for a stable linter, but the unarchived repository and active last commit suggest it is not abandoned. Install if you need local validation; skip if you only use Markdown or have no reStructuredText workflow.
Install
restructuredtext-lint on PyPI
pip
pip install restructuredtext-lintuv
uv add restructuredtext-lintpoetry
poetry add restructuredtext-lintInstalling restructuredtext-lint
Before you install
Low friction installation with a single runtime dependency (docutils). Package is aging (264 days since last release) but repository remains active and unarchived with a modest user base.
License in practice
Released to public domain under UNLICENSE, permitting unrestricted use, modification, and distribution with no attribution or warranty obligations.
Quickstart
pip install restructuredtext-lint
import restructuredtext_lint
errors = restructuredtext_lint.lint("Hello World\n=======\n")
print(errors[0].message if errors else "No errors")
Verify before relying
- Whether Python version support is truly unspecified or simply undocumented in the fact sheet
- Current state of Sphinx directive/role compatibility beyond the known limitations mentioned in docs
Package facts
| License | UNLICENSE (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — docutils |
| Maintenance | aging — 264 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 17,086,205/month — #1,133 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: restructuredtext_lint-2.0.2-py3-none-any.whl
Keywords: restructuredtext, restructured text, rest, rst, lint
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
collective.checkdocsAdds distutils commands to validate and preview…
copyleft · top 15,000 on PyPI
flake8-rst-docstringsA flake8 plugin that validates Python…
permissive · top 15,000 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
rstcheck-coreValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
doc8doc8 is a style checker for reStructuredText…
permissive · top 5,000 on PyPI
rich-rstRenders reStructuredText documents as Rich…
permissive · top 1,000 on PyPI
sphinx_mdincludeSphinx extension that lets you include and…
permissive · top 15,000 on PyPI
m2r2Converts markdown files with embedded…
permissive · top 15,000 on PyPI