Knonik Export

Export is the reverse of ingest: it reads data already in Knonik format - packed KHLP shards or pre-pack episode directories (both auto-detected) - and writes it back out in a format other tools can read. Use it to hand a dataset to software that does not speak Knonik, or to round-trip between formats.

Export ships in the same wheel as ingest and the dataloader (see Overview → Install) and is included in Knonik Standard. It uses the same login as ingest - if you can ingest, you can export, with no separate login:

bash
knonik login --product ingest

Supported Targets

Format--formatNotes
Zarrzarr
NumPynpy
HDF5hdf5
LeRobot v2 / v3lerobot_v2 / lerobot_v3
ROS bag / MCAProsbag / mcapROS1 .bag / ROS2 .mcap. Needs a dataset ingested with each stream at its own rate (see Ingest → Streams on different rates); a dataset resampled onto one clock no longer has the per-topic timing a bag claims, so it is refused.
RLDS / TFRecordrlds / tfrecordNeeds TensorFlow installed.
D3ILd3il

From The Terminal

bash
knonik export \
  --input  /home/me/data/out/knonik_thread_velcro \
  --output /home/me/data/exported/thread_velcro_hdf5 \
  --format hdf5
  • ▸--input is a Knonik-format path: a packed KHLP file/dir (containing hlp_manifest.json) or an episode directory produced by ingest. The input type is auto-detected; force it with --source khlp or --source episode_dir.
  • ▸--output is the destination directory.
  • ▸--name (optional) creates a directory of that name inside --output and writes the dataset into it. Without it, the export writes straight into --output.
  • ▸--format is the target from the table above. It overrides format in a --config file, if you pass one.

From Python

Use the public wrapper knonik.export.run, the mirror of knonik.ingest.run. It returns the list of written output paths.

python
from knonik.export import run

paths = run(
    input="/home/me/data/out/knonik_thread_velcro",
    output="/home/me/data/exported/thread_velcro_hdf5",
    format="hdf5",
)
print(paths)

You can also drive it from a config dict, with any per-exporter settings under options:

python
from knonik.export import run

run(config={
    "format": "lerobot_v3",
    "input":  "/home/me/data/out/knonik_thread_velcro",
    "output": "/home/me/data/exported/thread_velcro_lerobot",
    "options": {},          # per-exporter settings, when a target supports them
})

What Comes Across

  • ▸Every named camera, depth and numeric stream in the source.
  • ▸Episode boundaries, episode metadata and language instructions.
  • ▸Streams kept at their own rates stay at their own rates in hdf5, zarr, rosbag and mcap.

Video is re-encoded for formats that need a specific codec. For LeRobot targets you can copy the stored video instead of re-encoding it, which is much faster and frame-identical, by passing "options": {"video": "copy"}. Cameras whose codec the target cannot hold as-is are re-encoded automatically.