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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bytestory-0.1.0.tar.gz.
File metadata
- Download URL: bytestory-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/4.4.0-19041-Microsoft
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e17bf49e8b2e9192747b143b6fa798d007cea005b5eee54d7dfce4b506c7cff6
|
|
| MD5 |
840cf30b8828a81c39638c6ff3d13084
|
|
| BLAKE2b-256 |
ddc31deb82878e07d23da47881e39ac56d7c8cbce62425a77453e4e280fcc8b2
|
File details
Details for the file bytestory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bytestory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/4.4.0-19041-Microsoft
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3354d1575c05cfd811d9e9f9186c38548161a1b36edd89bd8a56eea407ed61b5
|
|
| MD5 |
6f3d5edf4bd863c10ae21e919b6ab435
|
|
| BLAKE2b-256 |
6c08d2b2b7f81b0251cd421a5c5e2d56205245b1695aee19cfc6c139b79cee82
|