--- id: protobuf-py version: "0.3.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # protobuf-py — Idiomatic Protocol Buffers for Python. License: permissive · Maintenance: active · Downloads: 338.5K/mo ## What it is and what it does protobuf-py is a Protocol Buffer implementation for Python that generates readable, type-annotated message classes from .proto files. Unlike alternatives that generate opaque runtime-constructed classes, protobuf-py produces inspectable Python code with proper IDE support and native type hints. It includes a Rust-backed encoder/decoder for performance and claims 100% conformance with the Protobuf specification. The library depends only on protobuf-py-ext at runtime and requires Python 3.10 or later. It supports typed oneofs with pattern matching, well-known types with helper methods, and reflection over message fields. Generated code uses direct field assignment and includes IDE-friendly presence checking. Use it for: - Define and serialize structured data for APIs using .proto schemas with full type safety. - Build message-driven systems where field presence tracking and oneof pattern matching improve code clarity. - Generate typed message classes that are inspectable and work well with IDE autocomplete and type checkers. - Serialize and deserialize binary data using the to_binary() and from_binary() methods. - Work with well-known types like Timestamp and Duration using built-in helper methods. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates well-typed, readable Python code from Protocol Buffer definitions and provides high-performance serialization/deserialization with a modern, ergonomic API. Yes, with conditions. The package is actively maintained, has low install friction, and offers genuine ergonomic improvements over alternatives (readable code, native type hints, direct field assignment). However, it is still in Alpha status with a first release only months old; production use should weigh stability risk against the benefits of better developer experience. No known vulnerabilities and permissive licensing are in its favor. ## Install pip install protobuf-py uv add protobuf-py poetry add protobuf-py ## Installing protobuf-py Before you install: Low friction: pure wheel distribution, single runtime dependency (protobuf-py-ext), and active maintenance with a release within the past week. License in practice: Apache-2.0 permissive license allows use in commercial and open-source projects without significant restrictions. Quickstart: from protobuf_py import Message # After code generation from .proto files: user = Message(id="123", first_name="Alice") data = user.to_binary() user = Message.from_binary(data) print(user.to_json()) Requires Python 3.10 or later. Code generation from .proto files requires external tooling; generated message classes must be created before importing and using them. Verify before relying: - Whether protobuf-py-ext is a compiled extension or pure Python, and what system dependencies it may require. - Performance benchmarks comparing encoder/decoder speed to other Protobuf implementations. - Stability guarantees given the Alpha development status and recent first release date. - Whether proto2 support is actually implemented or only proto3 is supported. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 338.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags protobuf python library, protocol buffers serialization, typed message generation, protobuf code generator, binary serialization python, protobuf schema compiler, rust-backed protobuf, serialization, code-generation, rpc [View on SkillFed](https://skillfed.io/packages/protobuf-py) · [View on PyPI](https://pypi.org/project/protobuf-py/)