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.

Filename, size & hash SHA256 hash help File type Python version Upload date
StructClass-1.0.2.linux-x86_64.exe (65.0 kB) Copy SHA256 hash SHA256 Windows Installer any Jun 30, 2013
StructClass-1.0.2.tar.gz (2.3 kB) Copy SHA256 hash SHA256 Source None Jun 30, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page