<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex" -->

---
title: protobuf-py: Protobuf for Python, without compromises · Buf
description: Buf has released protobuf-py, a new Protocol Buffers runtime for Python built from scratch. It passes the full Protobuf conformance suite across proto2,...
canonical: https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: protobuf-py: Protobuf for Python, without compromises · Buf | daily.dev
og:description: Buf has released protobuf-py, a new Protocol Buffers runtime for Python built from scratch. It passes the full Protobuf conformance suite across proto2,...
og:url: https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex
og:image: https://api.daily.dev/og/posts/Twtgzw6ex.png
og:image:alt: protobuf-py: Protobuf for Python, without compromises · Buf
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# protobuf-py: Protobuf for Python, without compromises · Buf

**[Hacker News](https://daily.dev/sources/hn)** · 7 min read · 3 upvotes · 0 comments

## Summary

Buf has released protobuf-py, a new Protocol Buffers runtime for Python built from scratch. It passes the full Protobuf conformance suite across proto2, proto3, and editions, supports extensions, custom options, unknown fields, dynamic messages, and well-known types. Unlike Google's protobuf package — which wraps a C engine and produces hard-to-read generated code with a C++/Java-shaped API — protobuf-py stores messages as plain Python objects with __slots__, generating readable, fully typed Python code with relative imports and no global type pool. An optional Rust accelerator provides performance comparable to Google's upb C engine on real end-to-end workloads (1.06x throughput vs upb), even though raw parse/serialize in isolation is slower. The library has no runtime dependencies, runs on Python 3.10+, and supports free-threaded Python 3.14.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://buf.build/blog/protobuf-py>

## Questions this post answers

### Is there a Python protobuf library that is both fully spec-compliant and feels idiomatic like Python?

Yes, protobuf-py is a from-scratch Protocol Buffers runtime for Python that passes every binary and JSON case in the official conformance suite across proto2, proto3, and editions, including extensions, custom options, unknown fields, dynamic messages, and well-known types, while generating readable, typed Python code with no runtime dependencies, unlike betterproto which only supports proto3.

_Developers weighing protobuf library choices in Python can track releases like this one via daily.dev._

### How does protobuf-py's performance compare to Google's upb C engine for Python?

With its optional Rust accelerator installed, protobuf-py matches or slightly exceeds upb on real end-to-end workloads, reaching 1.06x upb's throughput when building a full social-media home page response, even though upb wins on isolated parse (1.0x vs 0.22x) and serialize (1.0x vs 0.60x) microbenchmarks, because upb repeatedly pays a C-to-Python translation cost on every field read that protobuf-py pays only once.

_Teams benchmarking Python serialization libraries can follow performance comparisons like this through daily.dev._

### Why do generated _pb2.py files from Google's protobuf package look unreadable and hard to navigate?

Google's Python protobuf package uses the upb C engine, so messages live in a C arena and the Python object is just a handle into it; classes are assembled at import time to configure that C engine, meaning generated _pb2.py files contain little actual Python and going to their definition lands on serialized descriptor bytes rather than readable code.

_Python developers debugging generated protobuf code can find explanations like this through daily.dev._

## Similar posts on daily.dev

- [Better than JSON](https://daily.dev/posts/better-than-json-d2je9kyed) · Hacker News · 250 upvotes · 22 comments
- [Memory Buffer Protocol \(Python Language Summit 2026\)](https://daily.dev/posts/memory-buffer-protocol-python-language-summit-2026--zjryycu7w) · Python Insider · 0 upvotes · 0 comments
- [protobuf/benchmarks/gen\_synthetic\_protos.py at 336d6f04e94efebcefb5574d0c8d487bcb0d187e · protocolbuffers/protobuf](https://daily.dev/posts/protobuf-benchmarks-gen-synthetic-protos-py-at-336d6f04e94efebcefb5574d0c8d487bcb0d187e-protocolbu-gfszm2czc) · ElixirStatus · 0 upvotes · 0 comments
- [Protobuf-ES just got a lot faster · Buf](https://daily.dev/posts/protobuf-es-just-got-a-lot-faster-buf-rcovndatq) · Buf Blog · 18 upvotes · 1 comments

---

Tags: [#python](https://daily.dev/tags/python), [#backend](https://daily.dev/tags/backend), [#rust](https://daily.dev/tags/rust), [#grpc](https://daily.dev/tags/grpc)

[View this post on daily.dev](https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"protobuf-py: Protobuf for Python, without compromises · Buf","url":"https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex"},"datePublished":"2026-07-12T11:52:07.396Z","dateModified":"2026-09-14T07:25:35.384Z","description":"Buf has released protobuf-py, a new Protocol Buffers runtime for Python built from scratch. It passes the full Protobuf conformance suite across proto2,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/875ac88f330a6c648a78a2b1cac4dff4?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/875ac88f330a6c648a78a2b1cac4dff4?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,backend,rust,grpc","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"protobuf-py: Protobuf for Python, without compromises · Buf"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/protobuf-py-protobuf-for-python-without-compromises-buf-twtgzw6ex#faq","mainEntity":[{"@type":"Question","name":"Is there a Python protobuf library that is both fully spec-compliant and feels idiomatic like Python?","acceptedAnswer":{"@type":"Answer","text":"Yes, protobuf-py is a from-scratch Protocol Buffers runtime for Python that passes every binary and JSON case in the official conformance suite across proto2, proto3, and editions, including extensions, custom options, unknown fields, dynamic messages, and well-known types, while generating readable, typed Python code with no runtime dependencies, unlike betterproto which only supports proto3. Developers weighing protobuf library choices in Python can track releases like this one via daily.dev."}},{"@type":"Question","name":"How does protobuf-py's performance compare to Google's upb C engine for Python?","acceptedAnswer":{"@type":"Answer","text":"With its optional Rust accelerator installed, protobuf-py matches or slightly exceeds upb on real end-to-end workloads, reaching 1.06x upb's throughput when building a full social-media home page response, even though upb wins on isolated parse (1.0x vs 0.22x) and serialize (1.0x vs 0.60x) microbenchmarks, because upb repeatedly pays a C-to-Python translation cost on every field read that protobuf-py pays only once. Teams benchmarking Python serialization libraries can follow performance comparisons like this through daily.dev."}},{"@type":"Question","name":"Why do generated _pb2.py files from Google's protobuf package look unreadable and hard to navigate?","acceptedAnswer":{"@type":"Answer","text":"Google's Python protobuf package uses the upb C engine, so messages live in a C arena and the Python object is just a handle into it; classes are assembled at import time to configure that C engine, meaning generated _pb2.py files contain little actual Python and going to their definition lands on serialized descriptor bytes rather than readable code. Python developers debugging generated protobuf code can find explanations like this through daily.dev."}}]}
```

