Skip to main content

Protocol Buffer used to serialize and compress data

Project description

ZiProto

ZiProto is used to serialize data, ZiProto is designed with the intention to be used for transferring data instead of using something like JSON which can use up more bandwidth when you don't intend to have the data shown to the public or end-user

Setup

python setup.py install

Usage

To encode data, this can be done simply

>> import ziproto
>> ziproto.encode({"foo": "bar", "fruits": ['apple', 'banana']})
bytearray(b'\x82\xa6fruits\x92\xa5apple\xa6banana\xa3foo\xa3bar')

The same can be said when it comes to decoding

>> import ziproto
>> Data = ziproto.encode({"foo": "bar", "fruits": ['apple', 'banana']})
>> ziproto.decode(Data)
{'foo': 'bar', 'fruits': ['apple', 'banana']}

To determine what type of variable you are dealing with, you could use the decoder

>> import ziproto
>> from ziproto.ZiProtoDecoder import Decoder

>> Data = ziproto.encode({"foo": "bar", "fruits": ['apple', 'banana']})
>> SuperDecoder = Decoder(Data)
>> print(SuperDecoder.get_type())
ValueType.MAP

License

Copyright 2018 Zi Xing Narrakas

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details


Release history Release notifications | RSS feed

This version

1.0

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

ziproto-1.0-py3-none-any.whl (13.3 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