Skip to main content

Python implementation of protobuf_bytes

Project description

Protobuf Bytes for python

Contents

Install

To use protobuf_bytes, install package via pip install.

pip install protobuf_bytes

Or install from source.

python setup.py install

Get protobuf

The protobuf file is located here.

Examples

from bytes_pb2 import BytesMessage
from protobuf_bytes import Bytes, BytesType

m = BytesMessage()
m.type = BytesType.BYTES_TYPE_8U_C1
m.bigendian = False
m.data = bytes(range(12))
b = Bytes(m)

for i in range(b.length()):
    print(b.data_at(i))
// [0]
// [1]
// [2]
// [3]
// [4]
// [5]
// [6]
// [7]
// [8]
// [9]
// [10]
// [11]

m.type = BytesType.BYTES_TYPE_8U_C3
b = Bytes(m)
for i in range(b.length()):
    print(b.data_at(i))
// [0, 1, 2]
// [3, 4, 5]
// [6, 7, 8]
// [9, 10, 11]

APIs

Please reads docs/apis.md.

Project details


Download files

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

Files for protobuf-bytes, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size protobuf_bytes-1.0.0-py3.7.egg (6.4 kB) File type Egg Python version 3.7 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page