Skip to main content

Cross-product protocol buffers

Project description

Cross-product protocol buffers

Pipeline Status (protobuf)

A library of python bindings for protocol buffer definitions used by one or more products in the Matilda Peak product suite.

The protocol buffers are used across multiple components and languages. At the outset we anticipate supporting Python, and Java/Scala. The root of all packages is src/main as required by build tools like Gradle. From there the directory must be matildapeak followed by component directories or a common directory. An example protocol message file might be:

src/main/matildapeak/patterncomponent/DelayMessage.proto

Installation

The protocol buffers are published on PyPI and can be installed from there:

pip install matildapeak-prototobuf

Get in touch

  • Report bugs, suggest features or view the source code on GitLab.

Fixing the Python import

The Python protocol buffer bindings use relative imports and do not function properly (at least this is true of Python 3.6 and protobuf 3.1.0).

The issue appears to be well documented but a workaround is to adjust the system path to include the directory of the component’s site package. In a clean virtual environment this is easily achieved with the following:

import os
import sys
sys.path.append(os.path.join(sys.path[-1], 'patterncomponent'))

Rather than use [-1] a safer approach might be to locate the site-packages directory in the system path and use that - it may not be the last entry on the path.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

matildapeak_protobuf-2018.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file matildapeak_protobuf-2018.2-py3-none-any.whl.

File metadata

File hashes

Hashes for matildapeak_protobuf-2018.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a577893624a8d8bdb21e661d8235a391bce1059b73bef10d21937ee4c188a9b9
MD5 6197c0582f6bd145af1763fe34163989
BLAKE2b-256 8d8a6773beb77b8a826a72ebd915bec1d684e7f93e0725b14eeaaef1423376b9

See more details on using hashes here.

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