docstub 0.7.0


pip install docstub

  Latest version

Released: Nov 08, 2026


Meta
Maintainer: Lars Grüter
Requires Python: >=3.12

Classifiers

Development Status
  • 3 - Alpha

Environment
  • Console

Intended Audience
  • Developers
  • Science/Research

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: 3.15

Topic
  • Software Development :: Code Generators
  • Scientific/Engineering

docstub

[!NOTE] In early development! Docstub is not feature-complete or thoroughly tested yet. Its behavior, configuration or command line interface may change significantly between releases.

docstub is a command-line tool to generate Python stub files. It extracts necessary type information from NumPyDoc style docstrings.

Many packages in the scientific Python ecosystem already describe expected parameter and return types in their docstrings. Docstub aims to take advantage of these and help with the adoption of type annotations. It does so by supporting widely used readable conventions such as array of dtype or iterable of int(s) which are translated into valid type annotations.

Getting started & quick links

Specific guides:

Our release notes (latest) are in docs/release_notes/.

Our project follows Scientific Python's Code of Conduct.

Acknowledgements

Thanks to docs2stubs by which this project was heavily inspired and influenced.

And thanks to CZI for supporting this work with an EOSS grant.

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
numpydoc (>=1.7.0)
click (>=8.1.7)
libcst (>=1.3.1)
lark (>=1.1.9)
black (>=24.4.2)
isort (>=5.13.2)
pluggy