OS Manuals

/usr/bin/pybind11-stubgen

Commands for pybind11-stubgen installed for python3.11

From py3.11-pybind11-stubgen-bin 3.0.0-r1 (enterprise-packages), captured 2026-11-08 by running pybind11-stubgen --help (exit 0). permalink

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 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 (16)
OptionDescriptionSource
-h, --helpshow this help message and exithelp
--root-suffix ROOT_SUFFIXTop-level module directory suffixhelp
--ignore-invalid-expressions REGEXIgnore invalid expressions matching REGEXhelp
--ignore-invalid-identifiers REGEXIgnore invalid identifiers matching REGEXhelp
--ignore-unresolved-names REGEXIgnore unresolved names matching REGEXhelp
--ignore-all-errorsIgnore all errors during module parsinghelp
--enum-class-locations REGEX:LOCLocations of enum classes in <enum-class-name-regex>:<path-to-class> format.help
--numpy-array-wrap-with-annotatedReplace numpy/scipy arrays of 'ARRAY_T[TYPE, [*DIMS], *FLAGS]' format with 'Annotated[ARRAY_T, TYPE, FixedSize|DynamicSize(*DIMS), *FLAGS]'help
--numpy-array-use-type-varReplace 'numpy.ndarray[numpy.float32[m, 1]]' with 'numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float32]]'help
--numpy-array-remove-parametersReplace 'numpy.ndarray[...]' with 'numpy.ndarray'help
--print-invalid-expressions-as-isSuppress the replacement with '...' of invalid expressionsfound in annotationshelp
--print-safe-value-reprs REGEXOverride the print-safe check for values matching REGEXhelp
--print-value-commentsPrint attribute values as comments for debugging, i.e., '...help
--exit-codeOn error exits with 1 and skips stub generationhelp
--dry-runDon't write stubs.help
--stub-extension EXTThe 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.