C-style structs for Python
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.
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|
|cstruct-1.0-py2.4.egg (19.0 kB) Copy SHA256 hash SHA256||Egg||2.4||Aug 19, 2013|
|cstruct-1.0-py2.5.egg (18.9 kB) Copy SHA256 hash SHA256||Egg||2.5||Aug 19, 2013|
|cstruct-1.0-py2.6.egg (18.9 kB) Copy SHA256 hash SHA256||Egg||2.6||Aug 19, 2013|
|cstruct-1.0-py2.7.egg (18.8 kB) Copy SHA256 hash SHA256||Egg||2.7||Aug 19, 2013|
|cstruct-1.0-py3.1.egg (19.1 kB) Copy SHA256 hash SHA256||Egg||3.1||Aug 19, 2013|
|cstruct-1.0-py3.2.egg (19.3 kB) Copy SHA256 hash SHA256||Egg||3.2||Aug 19, 2013|
|cstruct-1.0-py3.3.egg (19.5 kB) Copy SHA256 hash SHA256||Egg||3.3||Aug 19, 2013|
|cstruct-1.0.tar.gz (7.3 kB) Copy SHA256 hash SHA256||Source||None||Aug 19, 2013|