docstring-inheritance
Avoid writing and maintaining duplicated docstrings.
Decision gist · record as of 2026-08-14
Yes, if you maintain a Python library with class hierarchies and use Sphinx or mkdocs for documentation. The package is actively maintained, has no known vulnerabilities, and solves a real documentation maintenance problem with minimal runtime overhead. Install it in your documentation build environment and enable it only during doc generation. Not necessary for projects with shallow hierarchies or those that don't use structured docstring formats.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; docstring inheritance is only applied when the environment variable DOCSTRING_INHERITANCE_ENABLE=1 is set (typically during documentation builds).
- Low install friction with a single runtime dependency (typing-extensions).
- The package is actively maintained with a recent release and supports modern Python versions (3.10–3.14).
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
last release 2025-12-11 (246 days) · last repo commit 2026-07-31 · 35 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 93,555 downloads/mo, #13,377 on PyPI
Alternatives
Verify before relying
pip install docstring-inheritance
from docstring_inheritance import NumpyDocstringInheritanceMeta
class Parent(metaclass=NumpyDocstringInheritanceMeta):
def method(self, x):
"""Summary.\n\n Parameters\n ----------\n x:\n Description.
"""
class Child(Parent):
def method(self, x):
"""Additional notes."""- Whether the package works correctly with all Sphinx and mkdocs configurations without additional setup beyond setting the environment variable.
- Performance impact when inheritance is enabled on large codebases with deep inheritance hierarchies.
What it is and what it does
docstring-inheritance is a Python package that automatically propagates docstrings from parent classes to their subclasses, reducing the need to write and maintain duplicate documentation. It understands both NumPy and Google docstring formats and handles inheritance at the section level—for example, inheriting individual parameter descriptions while allowing child classes to override or add new ones. The package uses metaclasses to intercept class creation and applies inheritance only when explicitly enabled via an environment variable, so it has negligible performance cost during normal runtime.
The package is designed to integrate with documentation build tools like Sphinx and mkdocs. It handles complex inheritance patterns, including multiple and multi-level inheritance, and can inherit docstrings for functions, methods, class methods, static methods, and properties. It also supports abstract base classes when combined with abc.ABCMeta, and can warn about missing parameter descriptions when configured.
Use it for
- Automatically populate child class docstrings during Sphinx or mkdocs documentation builds without manually repeating parent descriptions.
- Maintain consistent parameter documentation across a class hierarchy where child methods override parent signatures.
- Detect and report duplicated or similar docstring sections that could be consolidated through inheritance.
- Build libraries with deep inheritance hierarchies where manual docstring duplication becomes a maintenance burden.
- Ensure parameter documentation stays synchronized when child classes add or remove arguments from inherited methods.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you maintain a Python library with class hierarchies and use Sphinx or mkdocs for documentation.
The package is actively maintained, has no known vulnerabilities, and solves a real documentation maintenance problem with minimal runtime overhead. Install it in your documentation build environment and enable it only during doc generation. Not necessary for projects with shallow hierarchies or those that don't use structured docstring formats.
Install
docstring-inheritance on PyPI
Before you install
Low install friction with a single runtime dependency (typing-extensions). The package is actively maintained with a recent release and supports modern Python versions (3.10–3.14).
Requires Python 3.10 or later; docstring inheritance is only applied when the environment variable DOCSTRING_INHERITANCE_ENABLE=1 is set (typically during documentation builds).
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install docstring-inheritance
from docstring_inheritance import NumpyDocstringInheritanceMeta
class Parent(metaclass=NumpyDocstringInheritanceMeta):
def method(self, x):
"""Summary.\n\n Parameters\n ----------\n x:\n Description.
"""
class Child(Parent):
def method(self, x):
"""Additional notes."""
Verify before relying
- Whether the package works correctly with all Sphinx and mkdocs configurations without additional setup beyond setting the environment variable.
- Performance impact when inheritance is enabled on large codebases with deep inheritance hierarchies.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping-extensions |
| Maintenance | Actively maintained 246 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 93,555 / month, #13,377 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Operating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: docstring_inheritance-3.0.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 › “docstring inheritance python”
- docstring-inheritanceAutomatically inherits docstrings from parent classes to child…
- docrepDocrep provides utilities to intelligently reuse and deduplicate…
- overridesProvides a @override decorator that validates method overrides match…
Give your agent the search over MCP, or paste the wish link into any chat.
More Documentation packages
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
Sphinx generates professional documentation from reStructuredText source files, producing HTML, PDF, EPUB, and other formats with automatic cross-references, code highlighting, and hierarchical navigation.
Griffe extracts the complete structure and signatures of Python programs to generate API documentation or detect breaking changes in your project's public API.
Install it if you need to programmatically inspect Python code structure, generate API docs, or enforce API stability in CI.
A Sphinx extension that outputs documentation in serialized HTML formats (JSON and pickle) alongside standard HTML.
Alabaster is a clean, responsive Sphinx theme for documentation that requires Python 3.10 or newer and Sphinx 6.2 or newer.
A Sphinx extension that generates HTML help files from reStructuredText documentation source.
See also abstractcp · Acquisition · docrep · overrides · docstr-coverage · slotscheck · docstring-parser · docstring-parser-fork · mkdocstrings-python · numpydoc