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.
Project details
Release history Release notifications | RSS feed
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)
Built Distributions
cstruct-1.0-py3.3.egg
(19.5 kB
view hashes)
cstruct-1.0-py3.2.egg
(19.3 kB
view hashes)
cstruct-1.0-py3.1.egg
(19.1 kB
view hashes)
cstruct-1.0-py2.7.egg
(18.8 kB
view hashes)
cstruct-1.0-py2.6.egg
(18.9 kB
view hashes)
cstruct-1.0-py2.5.egg
(18.9 kB
view hashes)
cstruct-1.0-py2.4.egg
(19.0 kB
view hashes)