similar function to the builtin struct-library but more efficient
Project description
structlib-py
similar function to the builtin struct-library but more efficient
import structlib as sl
@dataclasses.dataclass
class MyStruct(sl.Structure):
name: Annotated[str, sl.String(10))]
value: int
sl.dumps(MyStruct("Hello World", 10))
MyStruct.struct_dumps(binary/stream)
b'\x12Hello World\x10'
sl.loads(binary/stream, type=MyStruct)
MyStruct.struct_load(binary/stream)
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
structurelib-0.0.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for structurelib-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ccdf48fb05ef816bdc5cf7c2f9582389c2e0c26cb8fcb97fc645227c1e8d151 |
|
MD5 | 3bf2ff0409f67e7dd2b332caf56a2e56 |
|
BLAKE2b-256 | 3ce9e78dc74aaace1abfff4da30bb7552dfabaf5ee6b553ebb3d7defe7e67095 |