Metadata-Version: 2.4
Name: docstub
Version: 0.4.0
Summary: Generate Python stub files from docstrings
Maintainer: Lars Grüter
License-Expression: BSD-3-Clause AND PSF-2.0
Project-URL: Homepage, https://github.com/lagru/docstub
Keywords: typing,stub files,docstings,numpydoc
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpydoc>=1.7.0
Requires-Dist: click>=8.1.7
Requires-Dist: libcst>=1.3.1
Requires-Dist: lark>=1.1.9
Requires-Dist: black>=24.4.2
Requires-Dist: isort>=5.13.2
Provides-Extra: dev
Requires-Dist: pre-commit>=3.7; extra == "dev"
Requires-Dist: ipython; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=5.0.0; extra == "test"
Requires-Dist: pytest-cov>=5.0.0; extra == "test"
Requires-Dist: mypy>=1.16.0; extra == "test"
Requires-Dist: basedpyright; extra == "test"
Dynamic: license-file

# docstub

> [!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](https://typing.python.org/en/latest/guides/writing_stubs.html) (i.e., PYI files) from type descriptions found in [numpydoc](https://numpydoc.readthedocs.io)-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.


## Installation & getting started

Please refer to the [user guide](https://github.com/scientific-python/docstub/blob/main/docs/user_guide.md) to get started with docstub.


## Contributing

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](https://github.com/scientific-python/docstub/issues/new/choose)! 🚀

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](https://scikit-image.org).
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](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/).
