Skip to main content

UNKNOWN

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

StructClass-1.0.2.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

StructClass-1.0.2.linux-x86_64.exe (65.0 kB view details)

Uploaded Source

File details

Details for the file StructClass-1.0.2.tar.gz.

File metadata

  • Download URL: StructClass-1.0.2.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for StructClass-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f762828f70267cf8f230542b09a9f2891301d6b2ec9faed68d7f9e074fe9160b
MD5 c42b0e144557e9a4042082b5fb70a63a
BLAKE2b-256 5529d475a9a3a93236fbad6437b122d400a8815bbe4334103dfbe587d7303d5f

See more details on using hashes here.

File details

Details for the file StructClass-1.0.2.linux-x86_64.exe.

File metadata

File hashes

Hashes for StructClass-1.0.2.linux-x86_64.exe
Algorithm Hash digest
SHA256 8eef204410159bca8a2ea28ee78c7cad1dd2db0ac7d3910c7e16a877fa6da6b2
MD5 2659cc57622d694295a052c212523200
BLAKE2b-256 72756e416e1da716129c5ac0fd4a07d80d4fa1011280a0e6e14e4704b18fbce0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page