Skip to main content

Generate Python MyPy stub modules from protobuf files.

Project description

pyprotostuben

Latest Version Python Supported Versions MyPy Strict Test Coverage Downloads GitHub stars

Generate Python modules from protobuf files.

usage

pypi package

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 containers
  • message-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 defs
  • grpc-skip-servicer -- don't generate code for servicers
  • grpc-skip-stub -- don't generate code for stubs
  • no-parallel -- disable multiprocessing
  • debug -- 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 multiprocessing
  • debug -- 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 format
  • dest={path} (default = request.json) -- specify file destination

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

pyprotostuben-0.3.4.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyprotostuben-0.3.4-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

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

Hashes for pyprotostuben-0.3.4.tar.gz
Algorithm Hash digest
SHA256 eb7daf4faeb54d5d382f73cca7a39961f3cf6f9264fda433f525876a15efaa5a
MD5 650a9fa5528fa8f25b225461c60df4d2
BLAKE2b-256 f0aa7700c1aa3acce362224ce8344811a77f17c32cfc6bb0eb4fc41ab96917c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyprotostuben-0.3.4.tar.gz:

Publisher: publish.yaml on zerlok/pyprotostuben

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pyprotostuben-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e565265fea9746a48ec63ce36eec73b0323dde3a4de429e9a9c6a7c724935dc5
MD5 3f93e8d50a053f81715c02e8cf5f27a3
BLAKE2b-256 0ed8722239a3814adf7cc1df51cba7b65be41cb537f9938b50e6d93435a5dfea

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyprotostuben-0.3.4-py3-none-any.whl:

Publisher: publish.yaml on zerlok/pyprotostuben

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page