docstrfmt
docstrfmt: A formatter for Sphinx flavored reStructuredText.
Decision gist · record as of 2026-08-14
Yes, if you work with reStructuredText or Sphinx-style docstrings and want automated, opinionated formatting. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe choice. The beta status and acknowledged gaps in construct coverage are worth noting if you rely on advanced reStructuredText features, but for typical docstrings and markup it is stable and ready to use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with no compiled dependencies.
- Active maintenance, last commit 2026-08-10, and the project is in beta but described as mostly stable.
License · maintenance · safety
permissive license (permissive) — Permissive license (MIT) means you can use, modify, and distribute this package freely in commercial and private projects without significant restrictions.
last release 2026-06-21 (54 days) · last repo commit 2026-08-10 · 43 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 81,877 downloads/mo, #14,194 on PyPI
Alternatives
Verify before relying
pip install docstrfmt
docstrfmt myfile.py
# or read from stdin and write to stdout:
cat myfile.py | docstrfmt- Coverage of less common reStructuredText constructs beyond the most common ones mentioned as currently supported.
- Performance characteristics when formatting large files or many files in batch.
- Stability guarantees or breaking-change policy given the beta status.
What it is and what it does
docstrfmt is a command-line tool that automatically formats reStructuredText markup and Python docstrings to a consistent, opinionated style. It draws inspiration from Black and rstfmt, aiming to reduce style discussions and manual formatting work by enforcing a single reasonable format. The tool reads Python files or raw reStructuredText and rewrites docstrings and markup according to its rules, with configurable line length that defaults to Black's 88 characters or can be read from pyproject.toml.
The package depends on Black, libcst, docutils, Sphinx, and related utilities to parse and reformat the text. It runs as a command-line tool or optionally as an HTTP daemon (docstrfmtd) to avoid repeated startup costs. Currently in beta, it covers most common reStructuredText constructs but acknowledges gaps in coverage for less common syntax.
Use it for
- Enforce consistent docstring formatting across a Python project's codebase automatically.
- Integrate docstring formatting into pre-commit hooks to catch style issues before commit.
- Format standalone reStructuredText files (e.g., documentation, README files) to match project conventions.
- Run as a daemon service to format docstrings on-demand via HTTP in editor plugins or CI pipelines.
- Migrate existing docstrings to a standardized format without manual editing.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with reStructuredText or Sphinx-style docstrings and want automated, opinionated formatting.
The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe choice. The beta status and acknowledged gaps in construct coverage are worth noting if you rely on advanced reStructuredText features, but for typical docstrings and markup it is stable and ready to use.
Install
docstrfmt on PyPI
Before you install
Low friction: pure Python wheel with no compiled dependencies. Active maintenance, last commit 2026-08-10, and the project is in beta but described as mostly stable.
Requires Python 3.10 or later.
License in practice
Permissive license (MIT) means you can use, modify, and distribute this package freely in commercial and private projects without significant restrictions.
Quickstart
pip install docstrfmt
docstrfmt myfile.py
# or read from stdin and write to stdout:
cat myfile.py | docstrfmt
Verify before relying
- Coverage of less common reStructuredText constructs beyond the most common ones mentioned as currently supported.
- Performance characteristics when formatting large files or many files in batch.
- Stability guarantees or breaking-change policy given the beta status.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 12 packagesblackclickcoveragedocutilsdocutils-stubslibcstplatformdirsromansphinxtabulatetomlitypes-docutils |
| Maintenance | Actively maintained 54 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 81,877 / month, #14,194 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DocumentationTopic :: Documentation :: SphinxTopic :: Software Development :: DocumentationTopic :: Utilities |
Evidence: docstrfmt-2.2.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “restructuredtext formatter”
- docstrfmtAutomatically formats reStructuredText in files and Python docstrings…
- sphinxcontrib-napoleonA Sphinx extension that converts Google and NumPy style docstrings…
- docstring-to-markdownConverts Python docstrings from reStructuredText and Google format to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also rich-rst · sphinx-lint · esbonio · restructuredtext-lint · rstcheck · flake8-rst-docstrings · blacken-docs · docstring-to-markdown · doc8 · rstcheck-core