The Python bindings for the jomiel protobuf messages.
The bindings have been generated from the protobuf declaration files of jomiel-proto
pip install jomiel-messages
Install from the repository, e.g. for development:
git clone https://github.com/guendto/jomiel-messages.git
cd jomiel-messages
./bin/gen
pip install -e .
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:
# ...
jomiel-messages
is licensed under the Apache License version
2.0.