Skip to main content

Python bindings for jomiel protobuf messages

Project description

jomiel-messages

pypi-pyversions pypi-v pypi-wheel pypi-status code-style

The Python bindings for the jomiel protobuf messages.

About

The bindings have been generated from the protobuf declaration files of jomiel-proto

Installation

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 .

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:
  # ...

License

jomiel-messages is licensed under the Apache License version 2.0.

Acknowledgements

Subprojects (as git subtrees)

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

jomiel_messages-0.2.1.1.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

jomiel_messages-0.2.1.1-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

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