Skip to main content

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:

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

Usage

Easiest from the command line:

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

See pyo3-stubgen --help for more details

Alternatively via the python API. See the docs for more details.

Issues, Bugs, Ideas

Please contribute on github MusicalNinjas/pyo3-stubgen.

Metadata

Release files for pyo3-stubgen 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyo3-stubgen 0.3.0
File Size Uploaded Provenance
pyo3_stubgen-0.3.0.tar.gz 5.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyo3-stubgen 0.3.0
File Interpreter ABI Platform
pyo3_stubgen-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / pyo3_stubgen-0.3.0.tar.gz

Download URL pyo3_stubgen-0.3.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
57434fb833d5a3e54942e6f5fde486b56412bf02319cf528068254da58b95327
BLAKE2b-256 checksum
How to use checksums
88dbdf405145366251eded9194a1bf2fdba544f44a4b5d571c519f7916ddec61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pyo3_stubgen-0.3.0-py3-none-any.whl

Download URL pyo3_stubgen-0.3.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a05c32ddf1981be043fa5015f24d625b4eb631c27769e0db475acf4b28e5acc3
BLAKE2b-256 checksum
How to use checksums
97fb92a4a232d31c00276085d03e6f96f28b940cc802cf69b07b8d892def293d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Security for pyo3-stubgen 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page