skillfed

protoc-gen-connect-python

Code generator for connect-python

protoc-gen-connect-python v0.9.0 255.2K downloads/30d#8,483 on PyPI142
Permissive license Apache-2.0 Active released

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

uv

uv add protoc-gen-connect-python

poetry

poetry add protoc-gen-connect-python

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: GoProgramming 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.14Topic :: Software Development :: Code GeneratorsTopic :: Software Development :: CompilersTopic :: System :: Networking

Tags

protoc plugin python code generationconnect rpc python codegenprotobuf python client server generatorconnect protocol python pluginrpc code generator pythonprotobuf schema to python codeconnect-rpc python stubs
code-generationprotobufrpc-framework

More Networking packages