{"categories":[{"label":"Build Tools","url":"https://skillfed.io/packages/category/software-development-build-tools"}],"enrichment":{"capability":"Generates mypy-compatible stub files (.pyi) from protobuf specifications, enabling static type checking of protobuf-generated Python code.","skillfed_tags":["protobuf","type-checking","code-generation"],"use_cases":["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."],"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\u2014including 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.\n\nThe 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.","worth_installing":"Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem\u2014enabling 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."},"id":"mypy-protobuf","links":{"html":"https://skillfed.io/packages/mypy-protobuf","md":"https://skillfed.io/packages/mypy-protobuf.md","pypi":"https://pypi.org/project/mypy-protobuf/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-28","license_spdx":null,"license_treatment":"permissive","name":"mypy-protobuf","python_support":"supports_current","summary":"Generate mypy stub files from protobuf specs"},"popularity":{"monthly_downloads":9374790,"position":1539,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"5.1.0"}
