pyprotogen
Lib for generation *_pb2.py from *.proto with helper methods
Installation
pip install pyprotogen
Usage
Generation
pyprotogen path/to/input/hello.proto path/to/output/
Generate as python-package
pyprotogen path/to/input/hello.proto path/to/package/output --package-version=0.0.1 --package-authors="Rick, Morty" --name="Package"
--name— optional;--package-version— required;--package-authors— optional;path/to/package/output— path to the directory where package will be saved.
Usage
- As client
from package.client import get_channel from package.gen.hello_pb2_grpc import HelloStub channel = get_channel(host="your.host") stub = HelloStub(channel)
- As server
from package.server import get_server from package.gen.hello_pb2_grpc import add_HelloServicer_to_server from package.gen.hello_pb2_grpc import HelloServicer class Hello(HelloServicer): pass server = get_server() add_HelloServicer_to_server(Hello(), server) server.add_insecure_port('[::]:50051') server.start() server.wait_for_termination()
Development
- Activate environment
rm -rf .venv || true python3 -m venv .venv source .venv/bin/activate make requirements
- Make changes
- Execute
make test
Metadata
Release files for pyprotogen 0.0.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyprotogen-0.0.27.tar.gz | 5.7 kB | Without provenance | Details for pyprotogen-0.0.27.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyprotogen-0.0.27-py3-none-any.whl | Python 3 | none | any | Details for pyprotogen-0.0.27-py3-none-any.whl |
Total release size: 15.7 kB
Release files / pyprotogen-0.0.27.tar.gz
| Download URL | pyprotogen-0.0.27.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0406c637f5f5a60f3eb54723fd76e602ff4b15bf974e85792fc750b7d9b5861e
|
|
BLAKE2b-256 checksum How to use checksums |
60ea5e8ff2698ece7bbc01e67f990ed1af5f0135b1d9af124a28af504903adfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure
|
Release files / pyprotogen-0.0.27-py3-none-any.whl
| Download URL | pyprotogen-0.0.27-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
852d36aa6f51255e15bed8e9b6cd32a5d72c9d74bc692766aa9605a2f5b4f4b9
|
|
BLAKE2b-256 checksum How to use checksums |
1f945e742e0439ab59edfe71eb075d6a511584fb847c948a35be13a61c88bb72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure
|
Security for pyprotogen 0.0.27
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.