$npx skillfedfor your agent

hatch-protobuf

A Hatch build plugin to generate Python files from Protocol Buffers .proto files

With conditionsPyPI Code GeneratorsReleased Jul 2025190.5K downloads / moMPL-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — hatch_protobuf-0.5.0-py3-none-any.whl
v0.5.0 · released 2025-07-16 · Python >=3.9 · 2 runtime deps: grpcio-tools, hatchling

Yes, if you use Hatch and Protocol Buffers. Low friction to install, no known vulnerabilities, actively maintained, and solves a real build-automation problem. The pre-alpha status (Development Status :: 2) suggests the API may change, so pin the version in your build dependencies. Not worth installing if you don't use Hatch or don't generate code from `.proto` files.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Hatch as your build system; grpcio-tools must be available in your environment to run protoc.
  • Low install friction; pure Python wheel with only two runtime dependencies (grpcio-tools and hatchling).
  • Repository is active with recent commits and no known vulnerabilities.

License · maintenance · safety

MPL-2.0 (copyleft) — Licensed under MPL-2.0 (copyleft). You must disclose source code modifications and distribute under the same license if you modify the plugin itself, though generated code is not affected.

last release 2025-07-16 (394 days) · last repo commit 2026-08-11 · 14 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 190,511 downloads/mo, #9,908 on PyPI

Verify before relying

# Add to pyproject.toml:
[tool.hatch.build.hooks.protobuf]
dependencies = ["hatch-protobuf"]

# Then run:
pip install hatch-protobuf
hatch build
  • Whether custom protoc plugins (e.g., TypeScript generators) work reliably with non-Python targets.
  • Performance characteristics when processing large numbers of .proto files or deeply nested proto_paths.
  • Compatibility with editable installs of packages that provide .proto files for import.
Same gist for agents: .md · .json

What it is and what it does

hatch-protobuf is a build-time plugin for the Hatch package manager that automates the generation of Python code from Protocol Buffer definitions. It wraps grpcio-tools' protoc compiler and integrates it into Hatch's build hook system, so `.proto` files are compiled to Python during package builds without manual steps.

The plugin generates Python message classes and gRPC service stubs by default, with optional `.pyi` type stub files for static analysis. It supports custom generators (e.g., for TypeScript or other languages), can import `.proto` definitions from installed packages via site-packages, and allows configuration of input/output paths and protoc options through `pyproject.toml`. It's designed for projects that use Protocol Buffers as part of their build process and want code generation to happen automatically during packaging.

Use it for

  • Generate gRPC service stubs and message classes during package build for microservices that use Protocol Buffers.
  • Consume `.proto` definitions from published packages (e.g., googleapis-common-protos) without rebuilding them.
  • Integrate custom protoc plugins (TypeScript, Go, etc.) into a Python project's build pipeline.
  • Maintain type stubs (.pyi files) alongside generated Protocol Buffer code for IDE and mypy support.
  • Automatically compile `.proto` files in src-layout or flat-layout projects with sensible defaults.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you use Hatch and Protocol Buffers.

Low friction to install, no known vulnerabilities, actively maintained, and solves a real build-automation problem. The pre-alpha status (Development Status :: 2) suggests the API may change, so pin the version in your build dependencies. Not worth installing if you don't use Hatch or don't generate code from `.proto` files.

Install

hatch-protobuf on PyPI

Before you install

Low install friction; pure Python wheel with only two runtime dependencies (grpcio-tools and hatchling). Repository is active with recent commits and no known vulnerabilities.

Requires Hatch as your build system; grpcio-tools must be available in your environment to run protoc.

License in practice

Licensed under MPL-2.0 (copyleft). You must disclose source code modifications and distribute under the same license if you modify the plugin itself, though generated code is not affected.

Quickstart

# Add to pyproject.toml:
[tool.hatch.build.hooks.protobuf]
dependencies = ["hatch-protobuf"]

# Then run:
pip install hatch-protobuf
hatch build

Verify before relying

  • Whether custom protoc plugins (e.g., TypeScript generators) work reliably with non-Python targets.
  • Performance characteristics when processing large numbers of .proto files or deeply nested proto_paths.
  • Compatibility with editable installs of packages that provide .proto files for import.

Package facts

LicenseMPL-2.0 copyleft
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
grpcio-toolshatchling
MaintenanceActively maintained 394 days since the last release
Last repo commit
First released
Downloads190,511 / month, #9,908 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 2 - Pre-AlphaFramework :: HatchIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Code Generators

Evidence: hatch_protobuf-0.5.0-py3-none-any.whl

Tags

Capabilities
protobuf code generationhatch build plugin protobufgrpc python file generationproto to python compilerhatch protobuf integrationprotocol buffers build hookgrpcio code generator
Topics
protobufgrpcbuild-automation
PyPI keywords
grpchatchprotobuf

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “hatch build plugin protobuf”

Give your agent the search over MCP, or paste the wish link into any chat.

More Code Generators packages

proto-plus Worth it
PyPI · Python Modules · released Aug 2026

Proto Plus wraps protocol buffers to provide Python classes that behave like native Python types while maintaining protocol buffer serialization and schema validation.

Install it if you're working with protocol buffers in Python and want a more Pythonic interface, or if you're using Google Cloud libraries that depend on it.

Apache-2.0pure Python · 3.10+
343.8Mdownloads / mo
Cython Worth it
PyPI · Python Modules · released Jul 2026

Cython is a source code translator that compiles Python code to C, enabling optional static typing and direct C/C++ interoperability to generate efficient native extensions.

Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.

permissive licensepure Python · 3.8+
136.1Mdownloads / mo
asttokens Worth it
PyPI · Python Modules · released Jul 2026

Annotates Python abstract syntax trees with the positions of tokens and source code text, enabling tools to map AST nodes back to their originating code for refactoring, analysis, and transformation.

permissive licensepure Python · 3.8+
134.8Mdownloads / mo
beartype Worth it
PyPI · Python Modules · released Dec 2025

Beartype is a runtime type checker that validates Python type hints at function call time, catching type violations before they cause downstream bugs.

Install it if you want runtime type safety for your annotated code or need to validate type hints on third-party packages.

MITpure Python · 3.10+
99.1Mdownloads / mo
llvmlite With conditions
PyPI · Code Generators · released Aug 2026

llvmlite provides a lightweight Python binding to LLVM's IR builder, optimizer, and JIT compiler APIs, enabling you to write JIT compilers and code generators without needing the full LLVM C++ API surface.

BSD-2-Clause AND Apache-2.0 WITH LLVM-exceptioncompiled wheel · 3.10+
69.3Mdownloads / mo
astor Worth it
PyPI · Code Generators · released Dec 2019

astor converts Python abstract syntax trees (ASTs) back to readable source code and provides tools for AST manipulation, inspection, and non-recursive tree traversal.

Install it if you need AST round-tripping or advanced tree inspection.

BSD-3-Clausepure Python
20.0Mdownloads / mo

See also grpcio-tools · opensearch-protobufs · protoletariat · setuptools-protobuf · nanopb · grpc-gateway-protoc-gen-openapiv2 · xds-protos · protoc-gen-openapiv2 · aristaproto · pylint-protobuf