endstone-stubgen
A next-generation stub generator for pybind11 modules, built with Griffe and Jinja2.
Overview
endstone-stubgen generates precise .pyi type stubs for C++/pybind11 codebases. It replaces the legacy
pybind11-stubgen workflow with a modern, modular, and more accurate architecture.
Originally built to support Endstone's pybind11 bindings, it works equally well for any pybind11 project.
Features
- Griffe-based introspection — Robust parsing of Python modules, pybind11 extensions, and custom metadata
- Jinja2 templating — Clean, extensible rendering with fully customizable
.pyitemplates - High-accuracy type inference — Better handling of overloads, enums, default values, and pybind11-bound C++ types
- Deterministic output — Stable, reproducible stub generation for large codebases
- PEP 561 compliant — Generated stubs work seamlessly with mypy, pyright, and other type checkers
Installation
pip install endstone-stubgen
Or with uv:
uv add endstone-stubgen
Usage
Basic Usage
Generate stubs for a module:
stubgen <module_name>
Specify Output Directory
stubgen <module_name> -o stubs/
Dry Run
Parse the module and report errors without writing files:
stubgen <module_name> --dry-run
CLI Reference
usage: stubgen [-h] [-o OUTPUT_DIR] [--dry-run] MODULE_NAME
positional arguments:
MODULE_NAME Module name to generate stubs for
options:
-h, --help Show this help message and exit
-o, --output-dir The root directory for output stubs (default: current directory)
--dry-run Parse module and report errors without writing stubs
Example
Generate stubs for the endstone module:
stubgen endstone -o stubs/
This creates a stubs/ directory with .pyi files mirroring the module structure:
stubs/
└── endstone/
├── __init__.pyi
├── command.pyi
├── event.pyi
└── ...
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for endstone-stubgen 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| endstone_stubgen-0.1.1.tar.gz | 8.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| endstone_stubgen-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 kB
Release files / endstone_stubgen-0.1.1.tar.gz
| Download URL | endstone_stubgen-0.1.1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7997d76d09c008325051444c7f7017b556f56fc7936fdb0de3d05a962a6973bf
|
|
BLAKE2b-256 checksum How to use checksums |
8a291681daeffccb388fc0447c86399c94c1aa90c11d98eef06663fb9696d386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.
Transparency logRelease files / endstone_stubgen-0.1.1-py3-none-any.whl
| Download URL | endstone_stubgen-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4048c11b393b9963457a3ab399de2449857391ece56f3e1cc40c627381284fe3
|
|
BLAKE2b-256 checksum How to use checksums |
3946426a0c607734f84dbf5a1ea5f34aa27e00dd5f09791def25de39494c6aef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.
Transparency logSecurity for endstone-stubgen 0.1.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for endstone_stubgen-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.
Transparency logA 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.