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. Pointers to where the documentation is confusing and unclear.
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. That said, if that only entices you, feel free to open a PR. But please do check in with an issue before you do so.
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.