Unpacking from bytes and packing into bytes, with an object interface.
Project description
ByteStory
Unpacking from bytes and packing into bytes, with an object interface.
Install
pip install bytestory
Usage
Unpacking from bytes
import bytestory
class OneByte(bytestory.ByteStory):
a = bytestory.Char
one_byte = OneByte(b'\x11')
assert one_byte.a == 0x11
Packing into bytes
import bytestory
class OneByte(bytestory.ByteStory):
a = bytestory.Char
one_byte = OneByte(a=0x11)
assert one_byte.pack() == b'\x11'
More examples at tests/test_bytestory.py.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bytestory-0.1.0.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for bytestory-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3354d1575c05cfd811d9e9f9186c38548161a1b36edd89bd8a56eea407ed61b5 |
|
MD5 | 6f3d5edf4bd863c10ae21e919b6ab435 |
|
BLAKE2b-256 | 6c08d2b2b7f81b0251cd421a5c5e2d56205245b1695aee19cfc6c139b79cee82 |