docrep
Python package for docstring repetition
What it is and what it does
Docrep is a documentation utility designed for developers building complex, nested Python APIs who want to avoid repeating the same docstring fragments across many functions or classes. It provides a way to define reusable docstring components once and reference them throughout your codebase, reducing maintenance burden and keeping documentation consistent.
The package works by letting you store docstring snippets (parameter descriptions, return value docs, etc.) in a central registry and then inject them into function or method docstrings at documentation-generation time. It integrates with reStructuredText and supports numpy and napoleon docstring conventions. However, the package has not been maintained since 2021-02-16, and its compatibility with modern Python versions and current documentation tooling is uncertain.
Use it for:
- Reduce duplication when many functions share the same parameter descriptions or return types in a large library.
- Maintain consistent documentation for repeated patterns across a nested API without manual repetition.
- Generate docstrings programmatically for auto-generated or templated code where manual repetition would be error-prone.
- Centralize and version-control common docstring fragments separately from implementation code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Docrep provides utilities to intelligently reuse and deduplicate docstrings across complex Python APIs, reducing repetition in documentation.
No. The package is abandoned (last release 2021-02-16) and targets Python versions up to 3.9, with no verification of compatibility with modern Python or current documentation tools. High install friction combined with maintenance risk makes it unsuitable for new projects. Consider actively maintained alternatives if you need docstring deduplication.
Install
docrep on PyPI
pip
pip install docrepuv
uv add docreppoetry
poetry add docrepInstalling docrep
Before you install
High install friction with no runtime dependencies. The package has been abandoned since 2021-02-16 and has not received updates in years, though it remains marked Production/Stable. Maintenance risk is substantial for a documentation tool where API changes in downstream projects may break workflows.
License in practice
Licensed under Apache-2.0 (permissive). You may use, modify, and distribute the package freely in commercial and private projects, provided you include the license notice.
Quickstart
pip install docrep
import docrep
# Use docrep.DocRep to define and reuse docstring fragments
rep = docrep.DocRep()
rep.define_doc("param_x", "x : int\n The x coordinate")
rep.doc("param_x")
Package classifiers indicate support for Python 2.7 and 3.4–3.9; compatibility with later versions is unverified. No runtime dependencies, but high install friction suggests potential build or environment issues.
Verify before relying
- Whether the package works reliably with Python versions beyond 3.9 despite classifier claims only extending to 3.9.
- Whether abandonment since 2021-02-16 has left the package incompatible with modern docstring conventions or current Sphinx versions.
- Concrete examples of how docrep integrates with napoleon, numpy, or reStructuredText docstring formats beyond keyword hints.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,005 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,613/month — #13,071 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: docrep-0.3.2.tar.gz
Keywords: docstrings, docs, docstring, napoleon, numpy, reStructured, text
Tags
More Documentation packages
Docutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
griffeGriffe extracts the complete structure and…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
docstring-inheritanceAutomatically inherits docstrings from parent…
permissive · top 15,000 on PyPI
autodocsummA Sphinx extension that enhances autodoc with…
permissive · top 5,000 on PyPI
attributes-docExtracts and stores docstrings for class…
permissive · top 15,000 on PyPI
docstring-to-markdownConverts Python docstrings from…
copyleft · top 5,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
mkdocstrings-python-legacyA legacy Python documentation handler for…
permissive · top 15,000 on PyPI
mkdocstrings-pythonGenerates API documentation for Python projects…
permissive · top 5,000 on PyPI
docformatterAutomatically formats Python docstrings to…
permissive · top 5,000 on PyPI
docstring-parser-forkParses Python docstrings in ReST, Google,…
permissive · top 5,000 on PyPI
interrogateInterrogate scans a Python codebase to measure…
permissive · top 5,000 on PyPI