Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sizmailov/pybind11-stubgen
Generate stubs for python modules
https://github.com/sizmailov/pybind11-stubgen
mypy pep484 pep561 pybind11 pycharm python typing
Last synced: 6 days ago
JSON representation
Generate stubs for python modules
- Host: GitHub
- URL: https://github.com/sizmailov/pybind11-stubgen
- Owner: sizmailov
- License: other
- Created: 2018-10-03T12:46:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-03T15:00:53.000Z (8 months ago)
- Last Synced: 2025-01-10T15:12:08.049Z (13 days ago)
- Topics: mypy, pep484, pep561, pybind11, pycharm, python, typing
- Language: Python
- Homepage:
- Size: 360 KB
- Stars: 253
- Watchers: 9
- Forks: 53
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![pypi](https://img.shields.io/pypi/v/pybind11-stubgen.svg?logo=PyPI&logoColor=white)](https://pypi.org/project/pybind11-stubgen/)
About
----Static analysis tools and IDE usually struggle to understand python binary extensions.
`pybind11-stubgen` generates [stubs](https://peps.python.org/pep-0561/) for python extensions to make them less opaque.While the CLI tool includes tweaks to target modules compiled specifically
with [pybind11](https://github.com/pybind/pybind11) but it should work well with modules built with other libraries.```bash
# Install
pip install pybind11-stubgen# Generate stubs for numpy
pybind11-stubgen numpy
```Usage
-----```
pybind11-stubgen [-h]
[-o OUTPUT_DIR]
[--root-suffix ROOT_SUFFIX]
[--ignore-invalid-expressions REGEX]
[--ignore-invalid-identifiers REGEX]
[--ignore-unresolved-names REGEX]
[--ignore-all-errors]
[--enum-class-locations REGEX:LOC]
[--numpy-array-wrap-with-annotated|
--numpy-array-use-type-var|
--numpy-array-remove-parameters]
[--print-invalid-expressions-as-is]
[--print-safe-value-reprs REGEX]
[--exit-code]
[--stub-extension EXT]
MODULE_NAME
```