flake8-docstrings
Extension for flake8 which uses pydocstyle to check docstrings
What it is and what it does
flake8-docstrings is a flake8 plugin that brings pydocstyle's docstring validation into the flake8 linting ecosystem. Instead of running pydocstyle separately, you configure it once in your flake8 setup and check docstrings alongside your other code quality rules. It supports multiple docstring conventions—PEP 257 (the default), numpy, and google—and lets you pick which error codes to enforce using flake8's standard --ignore and --select flags.
The package is lightweight and straightforward to integrate: install it, add a configuration line to your flake8 config (or pass --docstring-convention at the command line), and run flake8 as usual. It's useful for teams that want unified linting configuration and developers who prefer a single tool for all style checks rather than managing separate linters.
Use it for:
- Enforce numpy-style docstrings in scientific Python projects as part of CI/CD linting.
- Add docstring validation to an existing flake8 setup without changing your workflow.
- Enforce google-style docstrings in projects that prefer that convention over PEP 257.
- Selectively check specific docstring error codes using flake8's --select flag.
- Maintain consistent docstring standards across a team by centralizing the rule in flake8 config.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates pydocstyle docstring checking into flake8, allowing you to enforce docstring conventions (PEP 257, numpy, google, or custom) as part of your flake8 linting workflow.
Yes. This is a stable, actively maintained plugin with low install friction and no known vulnerabilities. Install it if you use flake8 and want to enforce docstring conventions without adding a separate linting tool to your workflow. The only caveat is that it hasn't been updated since January 2023, so verify compatibility with your current flake8 and pydocstyle versions before relying on it in new projects.
Install
flake8-docstrings on PyPI
pip
pip install flake8-docstringsuv
uv add flake8-docstringspoetry
poetry add flake8-docstringsInstalling flake8-docstrings
Before you install
Low friction: pure Python wheel, only two runtime dependencies (flake8 and pydocstyle). Actively maintained as of July 2026, with a stable release history since 2013.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install flake8-docstrings
flake8 --docstring-convention numpy your_file.py
Requires flake8 and pydocstyle to be installed; the available docstring conventions depend on your pydocstyle version.
Verify before relying
- Whether the package works with the latest versions of flake8 and pydocstyle released after January 2023.
- Performance impact when checking large codebases or projects with many files.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — flake8, pydocstyle |
| Maintenance | actively maintained — 1,297 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,053,070/month — #3,337 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flake8_docstrings-1.7.0-py2.py3-none-any.whl
Keywords: PEP 257, pydocstyle, pep257, docstrings, flake8
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
pydocstringformatterAutomatically formats Python docstrings to…
permissive · top 15,000 on PyPI
pydocstylepydocstyle is a static analysis tool that…
permissive · top 5,000 on PyPI
flake8-rst-docstringsA flake8 plugin that validates Python…
permissive · top 15,000 on PyPI
pydoclintPydoclint is a Python docstring linter that…
permissive · top 5,000 on PyPI
docformatterAutomatically formats Python docstrings to…
permissive · top 5,000 on PyPI
flake8-quotesA flake8 plugin that enforces consistent quote…
permissive · top 5,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
pep8-namingA flake8 plugin that checks Python code for…
permissive · top 5,000 on PyPI
flake8-commasA flake8 plugin that enforces trailing comma…
permissive · top 15,000 on PyPI
flake8-literalA flake8 plugin that enforces consistent…
copyleft · top 15,000 on PyPI