$npx skillfedfor your agent

pybind11-stubgen

PEP 561 type stubs generator for pybind11 modules

With conditionsPyPI Build ToolsReleased Aug 20251.3M downloads / moBSDPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pybind11_stubgen-2.5.5-py3-none-any.whl
v2.5.5 · released 2025-08-09 · Python ~=3.7

Yes, if you work with Python binary extensions and want static type checking or IDE support for them. It has no runtime dependencies, low friction, and solves a real problem—making opaque compiled code visible to the Python tooling ecosystem. Install it as a development or build-time tool.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python ~=3.7 or later; the target module must be importable in the environment where stubs are generated.
  • Low install friction; no runtime dependencies.
  • Actively maintained with recent commits and a steady release cadence since 2019.

License · maintenance · safety

BSD (permissive) — BSD license is permissive; you may use, modify, and distribute this package with minimal restrictions.

last release 2025-08-09 (370 days) · last repo commit 2026-08-04 · 359 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,336,440 downloads/mo, #4,032 on PyPI

Verify before relying

pip install pybind11-stubgen
pybind11-stubgen numpy
  • How well stub generation works for non-pybind11 extensions (documentation mentions it 'should work well' but provides no compatibility matrix).
  • Whether generated stubs are compatible with all major type checkers (mypy, pyright, etc.) or have known limitations.
Same gist for agents: .md · .json

What it is and what it does

pybind11-stubgen is a command-line tool that introspects compiled Python extensions and generates PEP 561 type stub files (.pyi) for them. Binary extensions—whether built with pybind11, ctypes, or other C/C++ binding libraries—are normally opaque to static type checkers and IDEs because their signatures and types exist only at runtime in compiled code. This tool bridges that gap by extracting type information from the running module and writing it out as stub files that tools like mypy, pyright, and IDEs can read.

The tool is designed primarily for pybind11 modules but works with other binding approaches. It offers command-line options to handle edge cases like invalid expressions, unresolved names, and special handling for NumPy arrays. Once stubs are generated, they sit alongside your extension modules and enable full IDE autocomplete, type checking, and documentation generation for code that uses those extensions.

Use it for

  • Generate stubs for NumPy or other scientific C extensions so type checkers can validate code using them.
  • Enable IDE autocomplete and inline documentation for third-party binary modules without source access.
  • Create type stubs for in-house pybind11 modules to integrate them into a typed Python codebase.
  • Support static analysis in CI/CD pipelines that use mypy or similar tools on code importing compiled extensions.
  • Publish type information alongside a compiled extension package to improve downstream user experience.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you work with Python binary extensions and want static type checking or IDE support for them.

It has no runtime dependencies, low friction, and solves a real problem—making opaque compiled code visible to the Python tooling ecosystem. Install it as a development or build-time tool.

Install

pybind11-stubgen on PyPI

Before you install

Low install friction; no runtime dependencies. Actively maintained with recent commits and a steady release cadence since 2019.

Requires Python ~=3.7 or later; the target module must be importable in the environment where stubs are generated.

License in practice

BSD license is permissive; you may use, modify, and distribute this package with minimal restrictions.

Quickstart

pip install pybind11-stubgen
pybind11-stubgen numpy

Verify before relying

  • How well stub generation works for non-pybind11 extensions (documentation mentions it 'should work well' but provides no compatibility matrix).
  • Whether generated stubs are compatible with all major type checkers (mypy, pyright, etc.) or have known limitations.

Package facts

LicenseBSD permissive
Python supportSupports the current Python release ~=3.7
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 370 days since the last release
Last repo commit
First released
Downloads1,336,440 / month, #4,032 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: pybind11_stubgen-2.5.5-py3-none-any.whl

Tags

Capabilities
type stubs for binary extensionspybind11 stub generationpython extension type hintsstatic analysis for compiled modulesIDE support for native extensionspep 561 stub generator
Topics
type-stubsstatic-analysispybind11

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “type stubs for binary extensions”

  • pybind11-stubgenGenerates PEP 561 type stubs for Python binary extensions, making…
  • construct-typingAdds type hints and static type checking support to the construct…
  • livekit-protocolProvides Python protocol stubs and type definitions for LiveKit's…

Give your agent the search over MCP, or paste the wish link into any chat.

More Build Tools packages

packaging Worth it
PyPI · Build Tools · released Aug 2026

Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.

Apache-2.0 OR BSD-2-Clausepure Python · 3.9+
2.2Bdownloads / mo
tqdm Worth it
PyPI · Libraries · released Jul 2026

Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
pip Worth it
PyPI · Build Tools · released Aug 2026

pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.

MITpure Python · 3.10+
617.5Mdownloads / mo
hatchling Worth it
PyPI · Python Modules · released Aug 2026

Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.

MITpure Python · 3.10+
484.2Mdownloads / mo
grpcio-tools Worth it
PyPI · Build Tools · released Jul 2026

Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.

Apache-2.0compiled wheel · 3.10+
278.2Mdownloads / mo
pre-commit Worth it
PyPI · Build Tools · released Aug 2026

pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.

Install it if your team needs consistent, automated validation at commit time.

permissive licensepure Python · 3.10+
179.9Mdownloads / mo

See also types-enum34 · docutils-stubs · types-backports · types-click · types-SQLAlchemy · types-attrs · types-Flask · types-Pillow · types-factory-boy · pybind11