https://github.com/scientific-python/docstub
Generate Python stub files from docstrings
https://github.com/scientific-python/docstub
Last synced: 2 months ago
JSON representation
Generate Python stub files from docstrings
- Host: GitHub
- URL: https://github.com/scientific-python/docstub
- Owner: scientific-python
- License: other
- Created: 2024-04-29T13:02:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-18T13:30:58.000Z (2 months ago)
- Last Synced: 2026-01-18T18:39:19.266Z (2 months ago)
- Language: Python
- Homepage: https://docstub.readthedocs.io
- Size: 405 KB
- Stars: 15
- Watchers: 3
- Forks: 6
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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](https://typing.python.org/en/latest/guides/writing_stubs.html).
It extracts necessary type information from [NumPyDoc style](https://numpydoc.readthedocs.io) 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
- [Documentation](https://docstub.readthedocs.io/) (see also [docs/](docs/))
Specific guides:
- [Installation (stable)](https://docstub.readthedocs.io/stable/installation.html)
- [Introduction (stable)](https://docstub.readthedocs.io/stable/introduction.html)
- [Contributing (latest)](https://docstub.readthedocs.io/latest/development/contributing.html)
Our [release notes (latest)](https://docstub.readthedocs.io/latest/release_notes/index.html) are in [docs/release_notes/](docs/release_notes).
Our project follows [Scientific Python's Code of Conduct](https://scientific-python.org/code_of_conduct/).
## Acknowledgements
Thanks to [docs2stubs](https://github.com/gramster/docs2stubs) by which this
project was heavily inspired and influenced.
And thanks to CZI for supporting this work with an [EOSS grant](https://chanzuckerberg.com/eoss/proposals/from-library-to-protocol-scikit-image-as-an-api-reference/).