Welcome to the KonF‘00’ Documentation¶
KonFoo is a Python Package for creating byte stream mappers in a declarative way with as little code as necessary to help fighting the confusion with the foo of the all well-known memory dumps or hexadecimal views of binary data.
It comes with sensible defaults out of the box.
It aims to make the process of reading, de-serializing, viewing, serializing and writing binary data from and back to a byte stream provider as easy as possible.
KonFoo in points:
- declarative way to describe the mapping of binary data to Python types
- declarative classes to read, deserialize, view, serialize and write binary data from and back to a data source
- easy adjustable byte stream provider bridge to any kind of data source
- nesting of classes
- adaptable classes on the fly while reading/de-serializing binary data
- easy syntax for accessing nested fields
- view the mapped binary data as a JSON string
- list the mapped binary data as a flatten list or dictionary
- write the mapped binary data to a
.csv
file - save the mapped binary data to an
.ini
file - load the mapped binary data from an
.ini
file - easy creatable nested metadata dictionaries of the members of a byte stream mapper
- metadata converter to the
flare.json
format to visualise the mapper with d3js.
KonFoo runs on Python 3.5 or higher.
You can get the latest version of KonFoo directly from GitHub:
You can get the library directly from PyPI:
> pip install konfoo
Documentation Contents¶
This part of the documentation guides you through all of the library’s usage patterns.
- Introduction
- Concept
- Mapper
- Containers
- Fields
- Structure
- Member
- Define a Structure
- Align Fields in a Structure
- Nest Structures
- Inherit from a Structure
- Declare on the fly
- Initialize a Structure
- Display a Structure
- Metadata of a Structure
- Size of a Structure
- Indexing
- De-Serializing
- Serializing
- Number of Members
- Access a Member
- Attributes of a Member Field
- Iterate over Members
- View Field Attributes
- View as a JSON string
- List Field Items
- List Field Attributes
- Write Field Attributes
- Save Field Attributes
- Load Field Values
- Sequence
- Member
- Create a Sequence
- Append a Member
- Insert a Member
- Extend a Sequence
- Initialize a Sequence
- Display a Sequence
- Metadata of a Sequence
- Size of a Sequence
- Indexing
- De-Serializing
- Serializing
- Number of Members
- Access a Member
- Attributes of a Member Field
- Iterate over Members
- View Field Attributes
- View as a JSON string
- List Field Items
- List Field Attributes
- Write Field Attributes
- Save Field Attributes
- Load Field Values
- Array
- Array Element
- Define an Array
- Array of Data Object Pointers
- Array Element Factory
- Create an Array
- Resize an Array
- Initialize an Array
- Display an Array
- Metadata of an Array
- Size of an Array
- Indexing
- De-Serializing
- Serializing
- Number of Array Elements
- Access an Array Element
- Attributes of an Array Element Field
- Iterate over Array Elements
- View Field Attributes
- View as a JSON string
- List Field Items
- List Field Attributes
- Write Field Attributes
- Save Field Attributes
- Load Field Values
- Pointer
- Relative Pointer
- Data Object
- Define a Data Object
- Define a Data Object Pointer
- Nest Pointers
- Access the Data Object
- Address of the Data Object
- Byte Order of the Data Object
- Byte Stream for the Data Object
- Declare on the fly
- Initialize a Pointer
- Display a Pointer
- Display the Data Object
- Metadata of a Pointer
- Size of the Data Object
- Indexing
- Index the Pointer Field
- Index the Data Object
- Reading
- De-Serializing
- Deserialize the Data Object
- Serializing
- Serialize the Data Object
- Writing
- Attributes of a Pointer Field
- View Field Attributes
- View as a JSON string
- List Field Items
- List Field Attributes
- Write Field Attributes
- Save Field Attributes
- Load Field Values
- Provider
- Reading
- Writing
- De-Serializing
API Reference¶
If you are looking for information on a specific function, class or method, this part of the documentation is for you.