Generate Python MyPy stub modules from protobuf files.
Project description
pyprotostuben
Generate Python modules from protobuf files.
usage
install with your favorite python package manager
pip install pyprotostuben
Then use protoc plugins to generate python code. See greeting examples for more info.
protoc plugins
protoc-gen-mypy-stub
Generates python stubs (*_pb2.pyi & *_pb2_grpc.pyi files which then used by MyPy type checker / IDE syntax highlits
& suggestions).
features:
- choose message structure immutability / mutability
- choose async / sync grpc module stubs
- grpc servicer abstract methods have full signature (with appropriate type args in generics), thus it is easier to implement methods in IDE
plugin options:
message-mutable-- add setters for fields, use mutable containersmessage-all-init-args-optional-- each field is optional in message constructor (even if field is not optional)grpc-sync-- use sync grpc stubs instead of grpc.aio module and async defsgrpc-skip-servicer-- don't generate code for servicersgrpc-skip-stub-- don't generate code for stubsno-parallel-- disable multiprocessingdebug-- turn on plugin debugging
protoc-gen-brokrpc
Generates *_brokrpc.py modules for BrokRPC framework. This is similar to gRPC
codegen (*_pb2_grpc.py modules).
plugin options:
no-parallel-- disable multiprocessingdebug-- turn on plugin debugging
protoc-gen-echo
Saves protoc plugin input to a file. Helps develop protoc plugins.
plugin options:
format={raw|binary|json}(default =raw) -- specify output formatdest={path}(default =request.json) -- specify file destination
Project details
Release history Release notifications | RSS feed
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 pyprotostuben-0.3.4.tar.gz.
File metadata
- Download URL: pyprotostuben-0.3.4.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb7daf4faeb54d5d382f73cca7a39961f3cf6f9264fda433f525876a15efaa5a
|
|
| MD5 |
650a9fa5528fa8f25b225461c60df4d2
|
|
| BLAKE2b-256 |
f0aa7700c1aa3acce362224ce8344811a77f17c32cfc6bb0eb4fc41ab96917c0
|
Provenance
The following attestation bundles were made for pyprotostuben-0.3.4.tar.gz:
Publisher:
publish.yaml on zerlok/pyprotostuben
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyprotostuben-0.3.4.tar.gz -
Subject digest:
eb7daf4faeb54d5d382f73cca7a39961f3cf6f9264fda433f525876a15efaa5a - Sigstore transparency entry: 163054990
- Sigstore integration time:
-
Permalink:
zerlok/pyprotostuben@c6f48af72c219546dec465d0f2573cffeed9ac6a -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/zerlok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@c6f48af72c219546dec465d0f2573cffeed9ac6a -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyprotostuben-0.3.4-py3-none-any.whl.
File metadata
- Download URL: pyprotostuben-0.3.4-py3-none-any.whl
- Upload date:
- Size: 37.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e565265fea9746a48ec63ce36eec73b0323dde3a4de429e9a9c6a7c724935dc5
|
|
| MD5 |
3f93e8d50a053f81715c02e8cf5f27a3
|
|
| BLAKE2b-256 |
0ed8722239a3814adf7cc1df51cba7b65be41cb537f9938b50e6d93435a5dfea
|
Provenance
The following attestation bundles were made for pyprotostuben-0.3.4-py3-none-any.whl:
Publisher:
publish.yaml on zerlok/pyprotostuben
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyprotostuben-0.3.4-py3-none-any.whl -
Subject digest:
e565265fea9746a48ec63ce36eec73b0323dde3a4de429e9a9c6a7c724935dc5 - Sigstore transparency entry: 163054991
- Sigstore integration time:
-
Permalink:
zerlok/pyprotostuben@c6f48af72c219546dec465d0f2573cffeed9ac6a -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/zerlok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@c6f48af72c219546dec465d0f2573cffeed9ac6a -
Trigger Event:
release
-
Statement type: