Note
In early development! Expect bugs, missing features, and incomplete documentation. Docstub is still evaluating which features it needs to support as the community gives feedback. Several features are experimental and included to make adoption of docstub easier. Long-term, some of these might be discouraged or removed as docstub matures.
docstub is a command-line tool to generate Python stub files (i.e., PYI files) from type descriptions found in 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 it translates into valid type annotations.
Please refer to the user guide to get started with docstub.
The best way you can help and contribute right now is by trying docstub out! Feedback to what features might still be missing or where it breaks for you would be greatly appreciated. As well as pointers to where the documentation is confusing and unclear. Feel welcome to open an issue! 🚀
Since docstub is still in early development there isn't an official contribution guide yet. Features and API are still being heavily extended and the internal structure is still somewhat in flux. The development is, in part, motivated by an effort to add type annotations to the scikit-image project. This may inform some short-term priorities and the roadmap.
That said, docstub is a project for the community and welcomes contributions in any form! Please do check in with an issue if you are interested in working on something.
Our project follows the Scientific Python's Code of Conduct.
Thanks to docs2stubs by which this project was heavily inspired and influenced.
And thanks to CZI for supporting this work with an EOSS grant.