$npx skillfedfor your agent

mypy-protobuf

Generate mypy stub files from protobuf specs

Worth itPyPI Build ToolsReleased Apr 20269.4M downloads / moApache License 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — mypy_protobuf-5.1.0-py3-none-any.whl
v5.1.0 · released 2026-04-28 · Python >=3.8 · 2 runtime deps: protobuf, types-protobuf

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem—enabling static type checking on protobuf code where the built-in pyi generator falls short. Install it if you use protobuf in Python and want mypy or pyright to catch type errors in your message handling and gRPC calls. Verify that your protoc and protobuf versions match the required minimums (>= 32.0) before installing.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires protoc >= 32.0 installed and on PATH, and python-protobuf >= 6.32 matching your protoc release.
  • Plugin runs on Python >= 3.9.
  • Low friction: pure Python wheel with only two runtime dependencies (protobuf and types-protobuf).

License · maintenance · safety

Apache License 2.0 (permissive) — Apache License 2.0 is permissive; you can use this package in commercial and private projects with minimal restrictions, provided you include a copy of the license and note any modifications.

last release 2026-04-28 (108 days) · last repo commit 2026-04-28 · 708 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 9,374,790 downloads/mo, #1,539 on PyPI

Verify before relying

pip install mypy-protobuf

protoc --python_out=output/location --mypy_out=output/location your_file.proto
  • Whether the generated stubs work correctly with mypy >= v1.14.0 or pyright >= 1.1.383 in your specific codebase.
  • Compatibility with grpc code generation (requires grpcio >= 1.70, grpcio-tools >= 1.70, types-grpcio >= 1.0.0.20251009).
Same gist for agents: .md · .json

What it is and what it does

mypy-protobuf is a protoc plugin that generates mypy-compatible stub files from .proto definitions. Instead of relying on the protobuf compiler's built-in pyi generator, it produces stubs with more precise type information—including correctly typed HasField, WhichOneof, and ClearField methods; gRPC service and client stubs; and field presence awareness. It also preserves comments from .proto files as docstrings and marks deprecated items with @warnings.deprecated.

The plugin installs as a protoc-gen-mypy executable that integrates into the protoc build pipeline. You run it alongside the standard Python code generator, and it outputs .pyi files that type checkers like mypy and pyright can use to validate code that imports and uses the generated protobuf messages. It requires protoc >= 32.0, python-protobuf >= 6.32, and Python >= 3.9 to run; downstream type checking also needs mypy >= v1.14.0 or pyright >= 1.1.383.

Use it for

  • Add static type checking to a Python project that uses protobuf messages, catching type errors at development time.
  • Generate gRPC service stubs with full type annotations for both server and client code.
  • Preserve proto file documentation as docstrings in generated stubs so IDEs and type checkers display help text.
  • Enforce field presence constraints in constructors and HasField calls by generating precise union and literal types.
  • Migrate a large protobuf codebase from untyped to typed Python incrementally using stub-based type checking.

Worth the install?

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

Worth it

Yes.

The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem—enabling static type checking on protobuf code where the built-in pyi generator falls short. Install it if you use protobuf in Python and want mypy or pyright to catch type errors in your message handling and gRPC calls. Verify that your protoc and protobuf versions match the required minimums (>= 32.0) before installing.

Install

mypy-protobuf on PyPI

Before you install

Low friction: pure Python wheel with only two runtime dependencies (protobuf and types-protobuf). Actively maintained with a recent release; last commit 2026-04-28. Requires protoc >= 32.0 and Python >= 3.9 to run the plugin itself.

Requires protoc >= 32.0 installed and on PATH, and python-protobuf >= 6.32 matching your protoc release. Plugin runs on Python >= 3.9.

License in practice

Apache License 2.0 is permissive; you can use this package in commercial and private projects with minimal restrictions, provided you include a copy of the license and note any modifications.

Quickstart

pip install mypy-protobuf

protoc --python_out=output/location --mypy_out=output/location your_file.proto

Verify before relying

  • Whether the generated stubs work correctly with mypy >= v1.14.0 or pyright >= 1.1.383 in your specific codebase.
  • Compatibility with grpc code generation (requires grpcio >= 1.70, grpcio-tools >= 1.70, types-grpcio >= 1.0.0.20251009).

Package facts

LicenseApache License 2.0 permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
protobuftypes-protobuf
MaintenanceActively maintained 108 days since the last release
Last repo commit
First released
Downloads9,374,790 / month, #1,539 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: mypy_protobuf-5.1.0-py3-none-any.whl

Tags

Capabilities
protobuf type stubsmypy protobuf stubsgenerate pyi from protoprotobuf type checkingmypy stub generationproto to pyi converterprotobuf static typing
Topics
protobuftype-checkingcode-generation
PyPI keywords
mypyprotodropbox

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 › “mypy protobuf stubs”

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 protobuf_to_pydantic · types-protobuf · googleapis-common-protos-stubs · hatch-protobuf · pylint-protobuf · types-grpcio · types-grpcio-health-checking · types-caldav · types-typed-ast