pure-protobuf
Protocol Buffers using Python type annotations
Decision gist · record as of 2026-08-14
Yes. Low install friction, active maintenance, permissive license, no vulnerabilities, and a clean annotation-based API make it a solid choice if you need protobuf serialization without code generation. Best suited for projects where keeping message definitions in Python code is a net win over managing `.proto` files—verify first that it handles the full range of protobuf types your use case requires.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low friction: pure Python wheel with only two lightweight runtime dependencies (get-annotations and typing-extensions).
- Active maintenance with recent commits and stable production status.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open and closed-source projects.
last release 2025-09-02 (346 days) · last repo commit 2026-05-14 · 291 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 79,503 downloads/mo, #14,352 on PyPI
Alternatives
Verify before relying
from dataclasses import dataclass
from io import BytesIO
from pure_protobuf.annotations import Field
from pure_protobuf.message import BaseMessage
from typing_extensions import Annotated
@dataclass
class SearchRequest(BaseMessage):
query: Annotated[str, Field(1)] = ""
page_number: Annotated[int, Field(2)] = 0
request = SearchRequest(query="hello", page_number=1)
buffer = bytes(request)
recovered = SearchRequest.read_from(BytesIO(buffer))- Whether the package handles nested messages, repeated fields, and all protobuf3 types beyond the basic examples shown.
- Performance characteristics compared to the official protobuf library for large message volumes.
- Compatibility with existing `.proto` schemas or whether it is strictly annotation-driven.
What it is and what it does
pure-protobuf lets you define Protocol Buffer messages using Python type annotations and dataclasses instead of `.proto` files and code generation. You annotate fields with Field(n) markers, inherit from BaseMessage, and the library handles serialization to and deserialization from protobuf wire format. It works with both plain dataclasses and Pydantic models, making it useful when you want protobuf's compact binary format without the separate schema compilation step.
The package depends on get-annotations and typing-extensions for runtime type introspection and annotation support across Python versions. It's actively maintained, supports Python 3.9 through 3.13, and carries no known security vulnerabilities. The annotation-driven approach trades the explicit schema definition of traditional protobuf for tighter integration with Python's type system.
Use it for
- Serialize and deserialize messages in microservices that need compact binary format without maintaining separate `.proto` files.
- Add protobuf support to existing dataclass or Pydantic models without code generation or schema compilation steps.
- Build RPC or message-passing systems where message definitions live alongside Python type hints.
- Store or transmit structured data in protobuf format when you prefer Python annotations over schema files.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, active maintenance, permissive license, no vulnerabilities, and a clean annotation-based API make it a solid choice if you need protobuf serialization without code generation. Best suited for projects where keeping message definitions in Python code is a net win over managing `.proto` files—verify first that it handles the full range of protobuf types your use case requires.
Install
pure-protobuf on PyPI
Before you install
Low friction: pure Python wheel with only two lightweight runtime dependencies (get-annotations and typing-extensions). Active maintenance with recent commits and stable production status.
Requires Python 3.9 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed-source projects.
Quickstart
from dataclasses import dataclass
from io import BytesIO
from pure_protobuf.annotations import Field
from pure_protobuf.message import BaseMessage
from typing_extensions import Annotated
@dataclass
class SearchRequest(BaseMessage):
query: Annotated[str, Field(1)] = ""
page_number: Annotated[int, Field(2)] = 0
request = SearchRequest(query="hello", page_number=1)
buffer = bytes(request)
recovered = SearchRequest.read_from(BytesIO(buffer))
Verify before relying
- Whether the package handles nested messages, repeated fields, and all protobuf3 types beyond the basic examples shown.
- Performance characteristics compared to the official protobuf library for large message volumes.
- Compatibility with existing `.proto` schemas or whether it is strictly annotation-driven.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0.0,>=3.9.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesget-annotationstyping-extensions |
| Maintenance | Actively maintained 346 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 79,503 / month, #14,352 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating 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.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: pure_protobuf-3.1.5-py3-none-any.whl
Tags
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 › “protobuf serialization without code generation”
- pure-protobufEncodes and decodes Protocol Buffer messages using Python type…
- betterprotoGenerates idiomatic Python code from Protobuf 3 and gRPC definitions,…
- betterproto-fwGenerates idiomatic Python code from Protobuf 3 and gRPC definitions,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also opensearch-protobufs · proto-schema-parser · proto-plus · protobuf3-to-dict · protoc-gen-validate · bbpb · gtfs-realtime-bindings · dbt-protos · protobuf-decoder · discord-protos