No project description provided
Project description
protoc-gen-py
The code generator plugin for Protocol Buffers for Python. Learn more about the project at github.com/bufbuild/protobuf-py.
Installation
protoc-gen-py generates base types—messages and enumerations—from your Protocol Buffer schema. The generated code requires the runtime library protobuf-py. It's compatible with Protocol Buffer compilers like buf and protoc.
To install the runtime library and the plugin, run:
$ uv add protobuf-py protoc-gen-py buf-bin
Generating code
With buf
Add a new buf.gen.yaml configuration file:
version: v2
inputs:
- directory: proto
plugins:
# This will invoke protoc-gen-py and write output to src/gen
- local: protoc-gen-py
out: src/gen
To generate code for all Protobuf files within your project, run:
$ uv run -- buf generate
Note that buf can generate from various inputs, not just local Protobuf files.
With protoc
$ uv run protoc --proto_path proto \
--py_out src/gen \
proto/a.proto proto/b.proto proto/c.proto
Plugin options
init_files
By default, the plugin creates __init__.py files in every directory of the generated output.
Set init_files=false to suppress this and produce namespace packages instead. Namespace packages allow multiple distribution packages to include modules under the same top-level package.
For example, in buf.gen.yaml:
plugins:
- local: protoc-gen-py
out: src/gen
opt: init_files=false
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file protoc_gen_py-0.1.0.tar.gz.
File metadata
- Download URL: protoc_gen_py-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c2a7a1b75528191e1029ae3016bc215e3bb4e7ed406e0a93891eee719f14692
|
|
| MD5 |
259d5ca77b93ae4e747867b749b7cffd
|
|
| BLAKE2b-256 |
acd24aa7e5957bd669ff9586dc48ad159533c30f9404b739ec2eb8acd1588fdc
|
Provenance
The following attestation bundles were made for protoc_gen_py-0.1.0.tar.gz:
Publisher:
release.yaml on bufbuild/protobuf-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protoc_gen_py-0.1.0.tar.gz -
Subject digest:
8c2a7a1b75528191e1029ae3016bc215e3bb4e7ed406e0a93891eee719f14692 - Sigstore transparency entry: 1928282859
- Sigstore integration time:
-
Permalink:
bufbuild/protobuf-py@edc74556608ac63f1f5a3a99906ef1dad91edc03 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bufbuild
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@edc74556608ac63f1f5a3a99906ef1dad91edc03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file protoc_gen_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: protoc_gen_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be6a98aacf613328153fe2b9c76f1f5448e4d955d7524751e7e7fd2b94d3378b
|
|
| MD5 |
39e08355388015b9dd3b0e2654466560
|
|
| BLAKE2b-256 |
838483bd23103f92a768461d59a5649503991a4bfb74e74eb3bb70d257a0554a
|
Provenance
The following attestation bundles were made for protoc_gen_py-0.1.0-py3-none-any.whl:
Publisher:
release.yaml on bufbuild/protobuf-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protoc_gen_py-0.1.0-py3-none-any.whl -
Subject digest:
be6a98aacf613328153fe2b9c76f1f5448e4d955d7524751e7e7fd2b94d3378b - Sigstore transparency entry: 1928286281
- Sigstore integration time:
-
Permalink:
bufbuild/protobuf-py@edc74556608ac63f1f5a3a99906ef1dad91edc03 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bufbuild
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@edc74556608ac63f1f5a3a99906ef1dad91edc03 -
Trigger Event:
push
-
Statement type: