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]
[--print-value-comments] [--exit-code] [--dry-run] [--stub-extension EXT]
MODULE_NAMES [MODULE_NAMES ...]
Generates stubs for specified modules
positional arguments:
MODULE_NAMES module names
options:
-h, --help show this help message and exit
-o, --output-dir OUTPUT_DIR
The root directory for output stubs
--root-suffix ROOT_SUFFIX
Top-level module directory suffix
--ignore-invalid-expressions REGEX
Ignore invalid expressions matching REGEX
--ignore-invalid-identifiers REGEX
Ignore invalid identifiers matching REGEX
--ignore-unresolved-names REGEX
Ignore unresolved names matching REGEX
--ignore-all-errors Ignore all errors during module parsing
--enum-class-locations REGEX:LOC
Locations of enum classes in <enum-class-name-regex>:<path-to-class>
format. Example: `MyEnum:foo.bar.Baz`
--numpy-array-wrap-with-annotated
Replace numpy/scipy arrays of 'ARRAY_T[TYPE, [*DIMS], *FLAGS]' format with
'Annotated[ARRAY_T, TYPE, FixedSize|DynamicSize(*DIMS), *FLAGS]'
--numpy-array-use-type-var
Replace 'numpy.ndarray[numpy.float32[m, 1]]' with 'numpy.ndarray[tuple[M,
typing.Literal[1]], numpy.dtype[numpy.float32]]'
--numpy-array-remove-parameters
Replace 'numpy.ndarray[...]' with 'numpy.ndarray'
--print-invalid-expressions-as-is
Suppress the replacement with '...' of invalid expressionsfound in
annotations
--print-safe-value-reprs REGEX
Override the print-safe check for values matching REGEX
--print-value-comments
Print attribute values as comments for debugging, i.e., '... # value =
<value>'
--exit-code On error exits with 1 and skips stub generation
--dry-run Don't write stubs. Parses module and report errors
--stub-extension EXT The file extension of the generated stubs. Must be 'pyi' (default) or 'py'
Options (17)
| Option | Description | Source |
|---|
-h, --help | show this help message and exit | help |
-o, --output-dir OUTPUT_DIR | The root directory for output stubs | help |
--root-suffix ROOT_SUFFIX | Top-level module directory suffix | help |
--ignore-invalid-expressions REGEX | Ignore invalid expressions matching REGEX | help |
--ignore-invalid-identifiers REGEX | Ignore invalid identifiers matching REGEX | help |
--ignore-unresolved-names REGEX | Ignore unresolved names matching REGEX | help |
--ignore-all-errors | Ignore all errors during module parsing | help |
--enum-class-locations REGEX:LOC | Locations of enum classes in <enum-class-name-regex>:<path-to-class> format. | help |
--numpy-array-wrap-with-annotated | Replace numpy/scipy arrays of 'ARRAY_T[TYPE, [*DIMS], *FLAGS]' format with 'Annotated[ARRAY_T, TYPE, FixedSize|DynamicSize(*DIMS), *FLAGS]' | help |
--numpy-array-use-type-var | Replace 'numpy.ndarray[numpy.float32[m, 1]]' with 'numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float32]]' | help |
--numpy-array-remove-parameters | Replace 'numpy.ndarray[...]' with 'numpy.ndarray' | help |
--print-invalid-expressions-as-is | Suppress the replacement with '...' of invalid expressionsfound in annotations | help |
--print-safe-value-reprs REGEX | Override the print-safe check for values matching REGEX | help |
--print-value-comments | Print attribute values as comments for debugging, i.e., '... | help |
--exit-code | On error exits with 1 and skips stub generation | help |
--dry-run | Don't write stubs. | help |
--stub-extension EXT | The file extension of the generated stubs. | help |
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.