docstring_generator¶
Stop writing boilerplate docstrings by hand.
docstring_generatorreads your type hints and generates professional, standards-compliant documentation in seconds — keeping your codebase clean, consistent, and AI-ready.
Python documentation tooling that automatically generates docstrings for functions and class methods from their type hints, with full support for NumPy, Google, and reStructuredText styles.
Why docstring_generator?¶
Good documentation is no longer optional. AI coding assistants, static analysis tools, and auto-generated API docs all depend on structured, accurate docstrings. Yet writing them by hand is tedious, error-prone, and rarely kept up-to-date.
docstring_generator solves this by:
- ⚡ Saving hours — generate docs for an entire codebase in one command
- 🔄 Staying in sync — re-running only updates what changed in the function signature
- ✍️ Preserving your words — existing descriptions and custom notes are never overwritten
- 🧠 AI-workflow friendly — well-structured docstrings improve context quality for LLM-assisted development
- 🚨 Exception-aware — automatically detects
raisestatements and documents them in aRaisessection - 🙈 Convention-correct —
selfandclsare automatically excluded from generated parameter sections - ⚙️ Async-ready — handles both
defandasync deffunctions transparently - 🎨 Style-safe — detects the existing docstring style and refuses to silently mix conventions
- 🏎️ Blazing fast — core engine written in C++ via pybind11
Quick Start¶
That's it. Your functions now have properly formatted docstrings.
💡 Prefer working inside your editor? Install the VS Code extension or use the JetBrains File Watcher to generate docstrings automatically on every save.
How It Works¶
The core engine is implemented in C++ (C++20) and exposed to Python via pybind11, delivering performance that scales to large codebases without slowing down your workflow.
- Extension: docstring-generator-ext — the high-performance backbone of this project
License¶
Apache-2.0 — free to use in personal and commercial projects.