Skip to main content

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

  1. Generate C++ from a .ksy schema using the Kaitai compiler with the Awkward target.
  2. Build a shared library from the generated .cpp.
  3. 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 awkward target.
  • 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

  1. 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.
  2. Awkward Target for Kaitai Struct, PyHEP Users Workshop 2023.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awkward_kaitai-0.11.2.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awkward_kaitai-0.11.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for awkward_kaitai-0.11.2.tar.gz
Algorithm Hash digest
SHA256 0082dd08e662dba6b1a0ae2637aea1f2b18555753ddce9adb56a1e4ddd2744a3
MD5 c8676913ef06fba86254dd1fe40248cb
BLAKE2b-256 c44dceae0d8b34a48a23ca2eeb11077a99a17dfc458a9c39432351d80e73291b

See more details on using hashes here.

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

Hashes for awkward_kaitai-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 65910f028c113884888e88b2b2bb475726f328a2ca9d002ac7ed8259ece35547
MD5 55510878c8f95f4ef3173141469a8a1a
BLAKE2b-256 2c59848faeb786a2adc871d2d0cd3df6b72a35adbc4960a88de21f3edf9425d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page