Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Describe and validate binary structures with easy django-style declarations.
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
pystruct
.gitignore
README.rst
coverage.cfg
runcoverage.py
setup.cfg
setup.py

README.rst

pyStruct

This module lets you describe binary structures by declaring python classes which syntanticly resamble C structures.

For example:

class Simple(CStruct):
    field = IntField()

Then packing and unpacking is very simple:

>>> obj = Simple(b'\x00\x00\x00\x05')
>>> print(obj.field)
5
>>> obj.bytes()
b'\x00\x00\x00\x05'
Something went wrong with that request. Please try again.