Struct to model (dataclass) for python
Project description
Welcome
Struct-Model - is an annotations based wrapper for python's built-in Struct
module.
from struct_model import StructModel, String, uInt4
class Form(StructModel):
username: String(16)
balance: uInt4
print(Form("Adam Bright", 12).pack())
# b'Adam Bright\x00\x00\x00\x00\x00\x00\x00\x00\x0c'
print(Form.unpack(b'Adam Bright\x00\x00\x00\x00\x00\x00\x00\x00\x0c').json())
# {"username": "Adam Bright", "balance": 12}
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
Built Distribution
Close
Hashes for struct-model-python-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfafbbe5cd24ced85f1437295a5d47d0219eb8cdee47a72f5aa1313bbd1b4aa4 |
|
MD5 | 0765e532fd7417efc83472734b4a56be |
|
BLAKE2b-256 | 02775b773124db9fa01b78d03db752670f3f6e4e2c94fb871af11ded6fd6a3c4 |
Close
Hashes for struct_model_python-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65b259409d15df39c320030644fe42dfbec6355ccf3b597c22579400568590d5 |
|
MD5 | 587aaf2d33421ff716b9af165ba83109 |
|
BLAKE2b-256 | 85b50fae8cacdb4b54547e41039b8e5b24287f356900b391349c9106e30eaccd |