StructClass
This Python module allows to manipulate binary packed objects as classes.
Similarly to the standard library struct module, objects can be packed or unpacked.
Usage example
>>> from structclass import StructClass
>>> SomePacket = StructClass('SomePacket', '<II', ['length', 'age'])
>>> my_packet, extra = SomePacket.unpack(b'123456789a')
>>> my_packet
SomePacket(length=875770417, age=943142453)
>>> my_packet.age
943142453
>>> my_packet.pack()
b'12345678'
>>> extra
b'9a'
>>> # Extra contains the bytes not used during unpacking
Metadata
Release files for StructClass 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| StructClass-1.0.2.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| StructClass-1.0.2.linux-x86_64.exe | Details |
Total release size: 67.4 kB
Release files / StructClass-1.0.2.tar.gz
| Download URL | StructClass-1.0.2.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f762828f70267cf8f230542b09a9f2891301d6b2ec9faed68d7f9e074fe9160b
|
|
BLAKE2b-256 checksum How to use checksums |
5529d475a9a3a93236fbad6437b122d400a8815bbe4334103dfbe587d7303d5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / StructClass-1.0.2.linux-x86_64.exe
| Download URL | StructClass-1.0.2.linux-x86_64.exe |
|---|---|
| Size | 65.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8eef204410159bca8a2ea28ee78c7cad1dd2db0ac7d3910c7e16a877fa6da6b2
|
|
BLAKE2b-256 checksum How to use checksums |
72756e416e1da716129c5ac0fd4a07d80d4fa1011280a0e6e14e4704b18fbce0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |