A convenient wrapper around the `struct` python module. It contains convenient reader and writer classes that can be used to write primitive data types in a specific byte order.
Project description
PyBinIO
PyBinIO - is a wrapper around the struct
python module. It contains
convenient reader and writer classes that can be used to write primitive data
types in a specific byte order.
In addition it supports:
- LEB128 for encoding unsigned variable length integers.
- Zigzag for encoding signed variable length integers.
Install
The package is available on PyPI.
$ python3 -m pip install pybinio
Usage
import binio
value = 255
writer = binio.BinaryWriter(binio.ByteOrder.LITTLE)
writer.write_uint8(value)
reader = binio.BinaryReader(writer.bytes, binio.ByteOrder.LITTLE)
assert value == reader.read_uint8()
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
Built Distribution
pybinio-0.1.2-py3-none-any.whl
(18.1 kB
view hashes)
Close
Hashes for pybinio-0.1.2.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a63de4a45e1de8594fbb50cc6fcc1ec53b69e5a7f89679b2d6eb38463e4ce3 |
|
MD5 | 194948b335407cd17f86ae78bc34de6d |
|
BLAKE2b-256 | 81228dba7a3a716db6e51babab26a7a4aaebe48f27e8b7baef19d3d6a6bfb6cb |