Skip to main content

Python implementation of stream library

Project description

Build Status PyPI Release PyPI Status Python License

pyStream

Python implementation of stream library.

Introduction

This library enables stream processing of protobuf messages; i.e. multiple protobuf messages can be written/read into/from a single stream or file.

It was originally developed to parse/write vg file formats (.vg, .gam, etc). However, it can be used for any arbitrary protocol buffer messages.

Refer to the C++ stream library for more details.

Encoding

The encoding is simple. Messages are written in groups of different sizes. Each group starts with its size; i.e. the number of messages in that group. Then, the size of each message is followed by the encoded message itself. Quoted from Google Protobuf Developer Guide:

The Protocol Buffer wire format is not self-delimiting, so protocol buffer parsers cannot determine where a message ends on their own. The easiest way to solve this problem is to write the size of each message before you write the message itself. When you read the messages back in, you read the size, then read the bytes into a separate buffer, then parse from that buffer.

By default, the stream is considered compressed by GZip. However, uncompressed stream processing is possible by passing gzip=False to any API calls (see optional GZip compression section).

Installation

You can install pyStream using pip:

pip install pystream-protobuf

Usage

See Wiki for usage documentation.

Development

In case, you work with the source code and need to build the package:

python setup.py build

The proto files in the test module required to be compiled before running test cases. To do so, it is required to have Google protobuf compiler (>=3.0.2) installed. After installing protobuf compiler, run:

make init

to compile proto files required for test module and then:

make test

to run tests.

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

pystream-protobuf-1.6.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

pystream_protobuf-1.6.0-py2.py3-none-any.whl (9.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pystream-protobuf-1.6.0.tar.gz.

File metadata

  • Download URL: pystream-protobuf-1.6.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.9

File hashes

Hashes for pystream-protobuf-1.6.0.tar.gz
Algorithm Hash digest
SHA256 9e1b360e94a9a517530a3e9912333b09c479fd3a9e7caa02c785555b99730797
MD5 feda8d06980fb78392c33fc5f8db8789
BLAKE2b-256 844191ee502a11ed47b1830968eb867870ed22a9fdf022109538bd394b49a21d

See more details on using hashes here.

File details

Details for the file pystream_protobuf-1.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pystream_protobuf-1.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.9

File hashes

Hashes for pystream_protobuf-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 318af25fcbd47f6c0148143c7c08d2bac17784bcaa5fdb2136072913a85d6686
MD5 e918244fc8916d070d96150a5ec2d5a1
BLAKE2b-256 2f55155c306bf905615bbe4f0ab9d4654fe5e437a18f89528b28e16dcf3f51a7

See more details on using hashes here.

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