Skip to content

Python (tet-py)

tet-py is the official Python package for Tetration. Install from PyPI, import tet, and use the same query engine and .tet layout as the Rust crate and tet CLI.

PyPI

tet-py 0.1.1 on PyPI: pip install tet-py

Do not pip install tetration — that PyPI name is unrelated math code.

Naming

RoleValue
PyPI / GitHubtet-py
Importimport tet
Rust coretetration 0.1.9 (linked at build time)
Native extensiontet._native (PyO3 / maturin, abi3 cp311+)

Python bindings use PyO3 → tetration rlib, not the C ABI layer. The C ABI remains in the tetration repo for Julia/R/Go embedders.

What's shipped (0.1.1)

TopicStatus
PyPI wheels (Linux, macOS, Windows)
Open .tet, catalog, info() / summary()
Reductions + QueryResult (preview=N.preview ndarray)
build_query, selections
NumPy ramread_numpy, transform.to_numpy
NumPy spillread_spill, transform.to_spill
NumPy sidecartransform.to_sidecar.*
NumPy writeTetWriter, write_dataset (f32/f64)
tet.convert extras (h5py, zarr, …)Planned
Zero-copy mmap → NumPyPlanned
Object-store paths (s3://…)Upstream tetration Phase 12

Sections

When to use each sink

SinkOutputTypical use
ramnumpy.ndarray in processNotebooks, arrays that fit memory budget
spillRow-major .bin beside sourceLarge transforms; reload with .to_numpy()
sidecarOne-chunk .tet beside sourceKeep transformed data as a mmap-friendly .tet (re-query, share, append pipeline)

Sidecar is transform-only (no top-level read_sidecar — the engine writes a derived .tet, then you side.open(f) or tet.open(path)). Spill is raw bytes; sidecar is a full catalog file. Sidecar vs TetWriter: sidecar presets path, naming, and provenance from the transform; TetWriter is general authoring from your array (NumPy — sidecar vs TetWriter).

Minimal example

python
import tet

with tet.open("data.tet") as f:
    print(tet.__version__, tet.core_version())
    print(f.mean("temperature"))
    r = f.mean("temperature", preview=32)   # QueryResult: scalar + capped preview
    arr = f.read_numpy("temperature")
    z = f.transform.to_numpy.zscore("temperature")
    side = f.transform.to_sidecar.zscore("temperature", path="temperature.zscore.tet")
    arr = side.to_numpy(f)

When to use what

NeedUse
Python notebooks / NumPy / pandastet-py
Fast HDF5/NetCDF/Zarr import on a machine with native libstet convert CLI
Custom Rust service or lowest-level controltetration crate
Other language bindingsC ABI / FFI

Latka Industries