Skip to main content

C-style structs for Python

Project description

Convert C struct definitions into Python classes with methods for serializing/deserializing.

Convert C struct definitions into Python classes with methods for serializing/deserializing. The usage is very simple: create a class subclassing cstruct.CStruct and add a C struct definition as a string in the struct field. The C struct definition is parsed at runtime and the struct format string is generated. The class offers the method “unpack” for deserializing a string of bytes into a Python object and the method “pack” for serializing the values into a string.

https://github.com/andreax79/python-cstruct

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

cstruct-1.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distributions

cstruct-1.0-py3.3.egg (19.5 kB view hashes)

Uploaded Source

cstruct-1.0-py3.2.egg (19.3 kB view hashes)

Uploaded Source

cstruct-1.0-py3.1.egg (19.1 kB view hashes)

Uploaded Source

cstruct-1.0-py2.7.egg (18.8 kB view hashes)

Uploaded Source

cstruct-1.0-py2.6.egg (18.9 kB view hashes)

Uploaded Source

cstruct-1.0-py2.5.egg (18.9 kB view hashes)

Uploaded Source

cstruct-1.0-py2.4.egg (19.0 kB view hashes)

Uploaded Source

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