Kaitai Struct runtime for Awkward Arrays
Project description
Kaitai Struct: Awkward Array runtime
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.
Quickstart
- 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 build
from awkward_kaitai import Reader
reader = Reader("test_artifacts/libhello_world.so")
array = reader.load("example_data/data/hello_world.bin")
print(array)
Documentation
The documentation is available at https://det-lab.github.io/kaitai_struct_awkward_runtime/.
Requirements
- Kaitai Struct compiler 0.11+ with the
awkwardtarget. - CMake and a C++ toolchain for building shared libraries.
Development
- 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.
Related Papers and Talks
- 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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awkward_kaitai-0.11.2.tar.gz.
File metadata
- Download URL: awkward_kaitai-0.11.2.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.11.2 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0082dd08e662dba6b1a0ae2637aea1f2b18555753ddce9adb56a1e4ddd2744a3
|
|
| MD5 |
c8676913ef06fba86254dd1fe40248cb
|
|
| BLAKE2b-256 |
c44dceae0d8b34a48a23ca2eeb11077a99a17dfc458a9c39432351d80e73291b
|
File details
Details for the file awkward_kaitai-0.11.2-py3-none-any.whl.
File metadata
- Download URL: awkward_kaitai-0.11.2-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.11.2 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65910f028c113884888e88b2b2bb475726f328a2ca9d002ac7ed8259ece35547
|
|
| MD5 |
55510878c8f95f4ef3173141469a8a1a
|
|
| BLAKE2b-256 |
2c59848faeb786a2adc871d2d0cd3df6b72a35adbc4960a88de21f3edf9425d5
|