protoc-gen-connect-python
Code generator for connect-python
What it is and what it does
protoc-gen-connect-python is a code generator plugin for the protoc compiler that transforms Protobuf service definitions into idiomatic Python code for the Connect RPC protocol. It sits in the buf code generation pipeline and outputs type-annotated stubs that work with both WSGI and ASGI frameworks on the server side, and provides client implementations on the client side.
Developers define their Protobuf schema once, run the generator, and get Python classes ready to subclass for servers or instantiate for clients. The plugin supports the Connect, gRPC, and gRPC-Web protocols, handles streaming natively, and integrates middleware and interceptors. The generated code is compatible with HTTP/1.1 and HTTP/2.
Use it for:
- Generate type-safe Python server stubs from a Protobuf service definition to implement with ASGI/WSGI frameworks.
- Create client code automatically from Protobuf schemas for calling remote services.
- Build polyglot APIs where the same schema generates clients in multiple languages.
- Set up RPC middleware for logging, tracing, and metrics via interceptors.
- Migrate from gRPC to Connect while maintaining protocol interoperability.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A protoc plugin that generates Python client and server code for the Connect RPC protocol from Protobuf service definitions.
Yes, if you are building or consuming Connect RPC services in Python. The plugin is actively maintained, has no known vulnerabilities, supports Python 3.10 through 3.14, and eliminates manual code duplication between client and server definitions. Install it as a dev dependency in your buf-based code generation workflow. Not necessary if you are not using Connect or Protobuf.
Install
protoc-gen-connect-python on PyPI
pip
pip install protoc-gen-connect-pythonuv
uv add protoc-gen-connect-pythonpoetry
poetry add protoc-gen-connect-pythonInstalling protoc-gen-connect-python
Before you install
Medium install friction: distributed as pre-built wheels across multiple platforms (macOS arm64/x86_64, Linux aarch64/x86_64, Windows amd64/arm64), but requires Python 3.10 or later and is typically installed as a development dependency.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for both open-source and proprietary projects.
Quickstart
# Install as development dependency
uv add --dev protoc-gen-connect-python
# Configure in buf.gen.yaml:
# version: v2
# plugins:
# - local: .venv/bin/protoc-gen-connectrpc
# out: gen
# Run buf generate to produce Python code from .proto files
Requires Python 3.10 or later; used as a protoc plugin within a buf code generation workflow, not as a runtime library.
Verify before relying
- Whether the plugin works with both protobuf-py and google-protobuf implementations without additional configuration.
- Performance characteristics and code generation speed for large Protobuf schemas.
- Compatibility with existing gRPC Python codebases during migration to Connect.
- What runtime dependencies the generated code requires beyond the protoc plugin itself.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 148 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 255,199/month — #8,483 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: protoc_gen_connect_python-0.9.0-py3-none-macosx_11_0_arm64.whl; protoc_gen_connect_python-0.9.0-py3-none-macosx_11_0_x86_64.whl; protoc_gen_connect_python-0.9.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl; protoc_gen_connect_python-0.9.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_1_x86_64.whl; protoc_gen_connect_python-0.9.0-py3-none-win_amd64.whl; protoc_gen_connect_python-0.9.0-py3-none-win_arm64.whl
Keywords: protoc, protobuf, protocol-buffers, code-generation, connect, connectrpc, connect-protocol, connect-rpc, rpc, compiler, plugin
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
connect-pythonProvides Python client and server libraries for…
permissive · top 5,000 on PyPI
connectrpcConnect is a runtime library for building and…
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
hatch-protobufA Hatch build plugin that generates Python…
copyleft · top 15,000 on PyPI
protobuf-pyGenerates well-typed, readable Python code from…
permissive · top 15,000 on PyPI
grpc-gateway-protoc-gen-openapiv2Generates Python support code for gRPC Gateway…
permissive · top 15,000 on PyPI
aristaprotoGenerates Python gRPC stubs and message classes…
permissive · top 15,000 on PyPI
betterprotoGenerates idiomatic Python code from Protobuf 3…
permissive · top 5,000 on PyPI
setuptools-protobufA setuptools plugin that automates compilation…
permissive · top 15,000 on PyPI