betterproto-fw
A better Protobuf / gRPC generator & library
What it is and what it does
betterproto-fw is a code generator and runtime library for Protobuf 3 and gRPC that produces modern, readable Python code using dataclasses, type hints, and async/await. It generates clean classes that inherit from betterproto.Message and support both binary and JSON serialization out of the box, using grpclib for async gRPC support.
The package includes both a protoc plugin (installed via the [compiler] extra) for code generation and a runtime library for using the generated code. It generates async-first gRPC stubs, supports Pydantic model generation, and uses Python's built-in datetime for timestamp/duration types. The wire format is identical to standard Protobuf, so generated code can interoperate with other Protobuf implementations.
Use it for:
- Generate async gRPC client and server stubs with full type hints and IDE completion support.
- Convert Protobuf message definitions into dataclasses for use in modern Python applications.
- Serialize and deserialize messages to/from JSON with configurable field naming (camelCase or snake_case).
- Build microservices using async/await patterns with gRPC and grpclib.
- Work with Protobuf 3 messages using timezone-aware datetime and timedelta objects.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates idiomatic Python code from Protobuf 3 and gRPC definitions, with built-in async/await support, JSON serialization, and modern type hints via dataclasses.
Yes, if you are building gRPC services or working with Protobuf 3 and want modern, readable generated Python code with async support. The low install friction and permissive MIT license make it straightforward. However, the aging maintenance status (453 days since last release) means you should verify that the generated code and runtime meet your current Protobuf and gRPC versions before committing to production.
Install
betterproto-fw on PyPI
pip
pip install betterproto-fwuv
uv add betterproto-fwpoetry
poetry add betterproto-fwInstalling betterproto-fw
Before you install
Low install friction with three lightweight runtime dependencies (grpclib, python-dateutil, typing-extensions). Package is aging—last release was 453 days ago—so maintenance activity is minimal; use only if the generated code meets your needs without expecting active updates.
License in practice
MIT license is permissive; you can use, modify, and distribute this package and code it generates with minimal restrictions, provided you retain the license notice.
Quickstart
pip install betterproto-fw
import betterproto
test = Greeting(message="Hello")
serialized = bytes(test)
another = Greeting().parse(serialized)
print(another.to_json())
Requires protoc compiler and grpcio-tools to generate code from .proto files; requires Python 3.9+.
Verify before relying
- Whether betterproto-fw is actively maintained or is a snapshot of an upstream project.
- Compatibility with the latest Protobuf 3 wire format and any breaking changes in recent gRPC releases.
- Performance characteristics compared to the official Google protoc Python plugin for large message volumes.
- Whether the fork maintains feature parity with the original betterproto project.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — grpclib, python-dateutil, typing-extensions |
| Maintenance | aging — 453 days since the last release |
| First released | |
| Downloads | 494,960/month — #6,344 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: betterproto_fw-2.0.3-py3-none-any.whl
Keywords: protobuf, gRPC
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
betterprotoGenerates idiomatic Python code from Protobuf 3…
permissive · top 5,000 on PyPI
aristaprotoGenerates Python gRPC stubs and message classes…
permissive · top 15,000 on PyPI
betterproto-rust-codecProvides fast Rust-based conversion between…
permissive · top 15,000 on PyPI
betterproto2Generates idiomatic Python code from Protobuf…
permissive · top 5,000 on PyPI
betterproto2-compilerGenerates idiomatic Python code from Protobuf 3…
permissive · top 15,000 on PyPI
hatch-protobufA Hatch build plugin that generates Python…
copyleft · top 15,000 on PyPI
grpc-gateway-protoc-gen-openapiv2Generates Python support code for gRPC Gateway…
permissive · top 15,000 on PyPI
twirpTwirp is a Python implementation of the Twirp…
unclear · top 5,000 on PyPI
protoc-gen-openapiv2Generates Python support code for gRPC Gateway…
permissive · top 5,000 on PyPI
grpclibgrpclib is a pure-Python asyncio-based…
permissive · top 1,000 on PyPI