Metadata-Version: 2.1
Name: pyo3-stubgen
Version: 0.3.0
Summary: Enable hinting for pyo3 extension modules by generating type and docstring stubs
Author: Mike Foster
License: MIT
Project-URL: Documentation, https://musicalninjas.github.io/pyo3-stubgen
Project-URL: Repository, https://github.com/MusicalNinjas/pyo3-stubgen
Project-URL: Issues, https://github.com/MusicalNinjas/pyo3-stubgen/issues
Project-URL: Changelog, https://github.com/MusicalNinjas/pyo3-stubgen/blob/main/CHANGELOG.md
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click
Provides-Extra: cov
Requires-Dist: pyo3-stubgen[test] ; extra == 'cov'
Requires-Dist: pytest-cov ; extra == 'cov'
Provides-Extra: dev
Requires-Dist: pyo3-stubgen[cov,doc,lint,test] ; extra == 'dev'
Provides-Extra: doc
Requires-Dist: black ; extra == 'doc'
Requires-Dist: mkdocs ; extra == 'doc'
Requires-Dist: mkdocstrings[python] ; extra == 'doc'
Requires-Dist: mkdocs-material ; extra == 'doc'
Provides-Extra: lint
Requires-Dist: ruff ; extra == 'lint'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-doctest-mkdocstrings ; extra == 'test'

# pyo3-stubgen

`pyo3-stubgen` generates `.pyi` typing files for extension modules which were written in rust with pyo3.

It is designed to work for extension modules created in rust with pyo3 but should work with any compiled extension
modules which include a `__text_signature__` and optionally a `__doc__` attribute for functions.

Despite flake8's recommendation to the contrary, `pyo3_stubgen` adds docstrings to the `.pyi` files so that IDEs can
provide them in hover pop-ups.

You will need to manually add the typing information to the generated files as this is not included in any of the
function attributes available and is just as dependent upon the semantics of your functions as on the technical
implementation.

Note: Currently `pyo3_stubgen` only generates info for functions. Classes are on the to-do list.

## Installation

Install via pip:

```sh
(.venv)/projectroot$ pip install pyo3-stubgen
```

## Usage

Easiest from the command line:

```sh
(.venv)/projectroot$ pyo3-stubgen MODULENAME OUTPUTLOCATION
```

See `pyo3-stubgen --help` for more details

Alternatively via the python API. See [the docs](https://musicalninjas.github.io/pyo3-stubgen) for more details.

## Issues, Bugs, Ideas

Please contribute on github [MusicalNinjas/pyo3-stubgen](https://github.com/MusicalNinjas/pyo3-stubgen).
