cstructs

Powerful decorator allowing the parsing of binary data into a dataclass and serializing back into raw data.


Keywords
data-science, python, reverse-engineering
License
GPL-3.0
Install
pip install cstructs==0.2.5

Documentation

cstructs

Think struct, but on steroids.

PyPI - Version PyPI - Python Version PyPI - License status


Note: This version supercedes the original cstruct package. This is my first attempt at a test driven development cycle, so I apologize in advance if the things that I do don't make sense.

Table of Contents

Installation

python -m pip install --user -U cstructs

Features

  • Serializing
  • Deserializing
  • Inheritance between datastructs
  • Sequences
  • Allow other datastructs to be members
  • Callbacks for reading/writing
  • Individual class metadata
  • Variable length data by depending on the value of another member
  • String decoding using specified encoding format
  • Lazy sequence loading
  • Fallback(default) value for missing values
  • Handling of various types of data alignment
  • Is type checker friendly

License

cstructs is distributed under the terms of the GNU GPL v3 license.