skillfed

betterproto-fw

A better Protobuf / gRPC generator & library

betterproto-fw v2.0.3 495.0K downloads/30d#6,344 on PyPI
Permissive license MIT AGING released

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-fw

uv

uv add betterproto-fw

poetry

poetry add betterproto-fw

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

protobuf code generation pythongrpc async pythonprotobuf to dataclassmodern protobuf pythongrpc stub generationprotobuf json serializationasync grpc client server
protobuf-codegenasync-grpcdataclass-serialization

More Software Development packages