Skip to main content

Welcome

Struct-Model

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}

Installation

Poetry

poetry add struct-model-python

PIP

pip install struct-model-python

Requirements

Metadata

Release files for struct-model-python 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for struct-model-python 0.2.0
File Size Uploaded
struct_model_python-0.2.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for struct-model-python 0.2.0
File Interpreter ABI Platform
struct_model_python-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / struct_model_python-0.2.0.tar.gz

Download URL struct_model_python-0.2.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
078db5ffc4409a643fef70204c784f101399aac5e1de377dbf99da9ea7f45fc6
BLAKE2b-256 checksum
How to use checksums
0a80c9160f3b2ab828f9dbc74e19688264dd6fa9e46ef40b657eefdee397d616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.9 Linux/6.2.0-1014-azure

Release files / struct_model_python-0.2.0-py3-none-any.whl

Download URL struct_model_python-0.2.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9e106c8045d519af389420d4a6eae5c61408047373a08e52932f4e766ed85f6
BLAKE2b-256 checksum
How to use checksums
0bbf92dddae3a3d258dbf6316f7440b13c0165389b46af52d0ee008662f07f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.9 Linux/6.2.0-1014-azure

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page