skillfed

pydocstringformatter

A tool to automatically format Python docstrings that tries to follow recommendations from PEP 8 and PEP 257.

pydocstringformatter v1.0.0 172.2K downloads/30d#10,345 on PyPI90
Permissive license MIT Active released

What it is and what it does

Pydocstringformatter is a command-line tool that reads Python source files and automatically reformats their docstrings to align with PEP 8 and PEP 257 style guidelines. It was created by contributors to the pylint project to address gaps in existing formatters, with a design philosophy that makes some of the more contentious PEP requirements optional rather than mandatory.

The tool handles common docstring issues: fixing quote styles, capitalizing summaries, normalizing whitespace, enforcing period terminators, and aligning multi-line docstrings. It supports multiple style guides simultaneously (e.g., pep257 and numpydoc), reads configuration from pyproject.toml, and integrates with pre-commit workflows. With zero runtime dependencies and active maintenance, it's designed as a lightweight addition to Python development toolchains.

Use it for:

  • Enforce consistent docstring formatting across a team or open-source project without manual review.
  • Integrate into CI/CD pipelines via pre-commit hooks to catch docstring style violations before merge.
  • Reformat legacy codebases to meet modern PEP 257 standards in bulk.
  • Configure project-specific docstring rules in pyproject.toml and apply them uniformly.
  • Use as a linting step alongside pylint to maintain documentation quality.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically formats Python docstrings to comply with PEP 8 and PEP 257 recommendations, with support for multiple style guides and configurable strictness.

Yes. The package is actively maintained, has no dependencies, requires only Python 3.11+, carries no known vulnerabilities, and solves a real problem in code quality enforcement. Install it if your team wants automated, configurable docstring formatting aligned with PEP standards.

Install

pydocstringformatter on PyPI

pip

pip install pydocstringformatter

uv

uv add pydocstringformatter

poetry

poetry add pydocstringformatter

Installing pydocstringformatter

Before you install

Low friction—pure Python wheel with no runtime dependencies. Actively maintained as of 41 days ago with recent commits and a stable release cycle.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pydocstringformatter

pydocstringformatter myfile.py

# Or with configuration in pyproject.toml:
[tool.pydocstringformatter]
write = true
style = "pep257"

Requires Python 3.11 or later.

Verify before relying

  • Whether the tool can be integrated into CI/CD pipelines beyond pre-commit hooks.
  • Performance characteristics when run on large codebases or projects with thousands of files.
  • How the tool handles edge cases in docstrings with complex formatting or non-ASCII characters.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 41 days since the last release
Last repo commit
First released
Downloads 172,192/month — #10,345 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pydocstringformatter-1.0.0-py3-none-any.whl

Keywords: python, docstring, format

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Quality Assurance

Tags

python docstring formatterpep 257 docstring auto-formatdocstring style checkerautomatic docstring lintingpep 8 compliance tooldocstring formatting cli
code-qualitydocstring-formattingpep-compliance

More Quality Assurance packages