Python API
Measure, pick, run.
The high-level API has four calls.
profile ranks recipes for a tile.
graph builds a reusable graph.
compress returns a frame.
decompress returns flat bytes.
the Python API
one workflow
One tile selects the pipeline. Every matching tile reuses it.
signature profile(tile, *, prior="planar", width=None, planes=None, error=None, reps=5, nodata=None, verify=False) → list[dict]
priorstr · NonePredictor filter.
None tries all; "none" disables prediction.widthint · NoneRow length; defaults to
tile.shape[-1].planesint · NoneStack count; defaults to
B for (B, Y, X).repsintTimed runs per recipe.
errorstr · NoneLossy recipe passed to
graph.nodatascalar · NoneMissing-value sentinel.
→ rowdictRecipe, size, ratio and throughput; sorted by ratio.
signature graph(raster, method, *, width=None, planes=None, error=None, nodata=None) → Graph
rasterndarrayNative-order array; 1, 2, 4 or 8 bytes per sample.
methodstrRecipe returned by
profile.widthint · NoneRow length; defaults to
raster.shape[-1].planesint · NoneStack count; row predictors reset between planes.
errorstr · None
None, LINEAR, LOG or SQRT.nodatascalar · NoneSentinel; omitted NaNs are detected automatically.
signature compress(tile, *, graph) → bytes
tilendarrayMatching dtype; geometry is not checked.
graphGraphReusable graph; not thread-safe.
→ framebytesSelf-describing OpenZL frame.
signature decompress(frame, *, verify=True, max_output_size=None) → ndarray
framebytesReturns flat
uint8.verifyboolChecks frame checksums.
max_output_sizeint | NoneCeiling on the bytes allocated. The size is read from the frame, so pass one for untrusted input.