Python bindings for jomiel protobuf messages
Project description
jomiel-messages
The Python bindings for the jomiel protobuf messages.
About
The purpose of this project is to provide the jomiel protobuf message
bindings package that are easy to install
from PyPI. The bundled have
been generated from the protobuf declaration files of jomiel-proto.
Installation
pip install jomiel-messages
Usage
Serialize an inquiry message:
from jomiel_messages.protobuf.v1alpha1.message_pb2 import Inquiry
inquiry = Inquiry()
inquiry.media.input_uri = 'https://foo.bar/baz'
serialized_string = Inquiry.SerializeToString(inquiry)
# ...
De-serialize a response message:
from jomiel_messages.protobuf.v1alpha1.message_pb2 import Response
from jomiel_messages.protobuf.v1alpha1.status_pb2 import STATUS_CODE_OK
response = Response()
response.ParseFromString(serialized_string)
if response.status.code != STATUS_CODE_OK:
print(f"message={response.status.message})
print(f"status-code={response.status.code}")
print(f"error-code={response.status.error}")
print(f"http-code={response.status.http.code}")
# ...
else:
# ...
Building packages from repo
git clone https://github.com/guendto/jomiel-messages
cd jomiel-messages
./bin/gen
git tag -s KEYID -am 'jomiel-messages version VERSION (INITIALS)' TAGNAME
pip install pep517
python -m pep517.build [-s|-b] .
The packages are created under the dist/ dir.
License
jomiel-messages
is licensed under the Apache License version
2.0.
Acknowledgements
Subprojects (as git subtrees)
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
jomiel_messages-0.2.0.tar.gz
(13.6 kB
view hashes)
Built Distribution
Close
Hashes for jomiel_messages-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd98a52bda612ba593c983e7f86bfdf26e8f92d19199d46a6d06e2168e5667fd |
|
MD5 | a482845c45fd5ab1253d6a925f7a2fdf |
|
BLAKE2b-256 | 932bced4f0ee936737f9b5087ad15140de8db73c421c09c0b8d96bac5175a8de |