This project bridges Kaitai Struct schemas to Awkward Arrays. It provides a C++ runtime plus Python helpers so Kaitai-generated parsers can emit Awkward Array buffers directly.
- Generate C++ from a
.ksyschema using the Kaitai compiler with the Awkward target. - Build a shared library from the generated
.cpp. - Load binary data into an Awkward Array.
Example flow:
# From a schema (requires kaitai-struct-compiler with awkward target)
java -cp <classpath> io.kaitai.struct.JavaMain -t awkward --outdir test_artifacts example_data/schemas/hello_world.ksy
# Build a shared library from the generated C++ file
awkward-kaitai-build test_artifacts/hello_world.cpp -b buildfrom awkward_kaitai import Reader
reader = Reader("test_artifacts/libhello_world.so")
array = reader.load("example_data/data/hello_world.bin")
print(array)The documentation is available at https://det-lab.github.io/kaitai_struct_awkward_runtime/.
- Kaitai Struct compiler 0.11+ with the
awkwardtarget. - CMake and a C++ toolchain for building shared libraries.
- Build and test everything:
make test - Fast loop for a single schema:
make compile_test testcase=hello_world - Linting and checks:
nox -s lint/nox -s pylint/nox -s tests - Submodule setup:
git submodule update --init --recursive
See AGENTS.md for detailed contributor guidance.
- Describe Data to get Science-Data-Ready Tooling: Awkward as a Target for Kaitai Struct YAML, Advanced Computing and Analysis Techniques for Physics Research Workshop 2024, New York, US.
- Awkward Target for Kaitai Struct, PyHEP Users Workshop 2023.