skillfed

protobuf-py

Idiomatic Protocol Buffers for Python.

protobuf-py v0.3.0 338.5K downloads/30d#7,431 on PyPI88
Permissive license Apache-2.0 Active released

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 on this page — 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

protobuf-py on PyPI

pip

pip install protobuf-py

uv

uv add protobuf-py

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — protobuf-py-ext
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 338,468/month — #7,431 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: protobuf_py-0.3.0-py3-none-any.whl

Keywords: protobuf

Development Status :: 3 - AlphaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free ThreadingTopic :: File FormatsTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

protobuf python libraryprotocol buffers serializationtyped message generationprotobuf code generatorbinary serialization pythonprotobuf schema compilerrust-backed protobuf
serializationcode-generationrpc

More Python Modules packages