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:
knonik login --product ingest
Supported Targets
| Format | --format | Notes |
|---|---|---|
| Zarr | zarr | |
| NumPy | npy | |
| HDF5 | hdf5 | |
| LeRobot v2 / v3 | lerobot_v2 / lerobot_v3 | |
| ROS bag / MCAP | rosbag / mcap | ROS1 .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 / TFRecord | rlds / tfrecord | Needs TensorFlow installed. |
| D3IL | d3il |
From The Terminal
knonik export \
--input /home/me/data/out/knonik_thread_velcro \
--output /home/me/data/exported/thread_velcro_hdf5 \
--format hdf5
- ▸
--inputis a Knonik-format path: a packed KHLP file/dir (containinghlp_manifest.json) or an episode directory produced by ingest. The input type is auto-detected; force it with--source khlpor--source episode_dir. - ▸
--outputis the destination directory. - ▸
--name(optional) creates a directory of that name inside--outputand writes the dataset into it. Without it, the export writes straight into--output. - ▸
--formatis the target from the table above. It overridesformatin a--configfile, 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.
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:
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,rosbagandmcap.
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.