Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.2 instead.

tet-py

PyPI Docs uv CI Python License

Python bindings for Tetration — mmap-friendly .tet tensor files and the JSON/TOML query engine.

| Install (PyPI) | pip install tet-py | | Import | import tet | | Rust core | tetration on crates.io | | CLI (no Python) | tet binary from the main repo |

Status (0.1.2): read/query (incl. preview=N, TOML queries, memory_budget_* kwargs); NumPy ram / spill / sidecar (incl. f16/u32/u64 export + read_numpy budget preflight); TetWriter / write_dataset (layout-v1 floats + integers); tet.convert for .npy/.npz (other formats stubbed via extras). Pins tetration 0.1.12. See CHANGELOG.md and docs/HANDOFF.md.

Do not pip install tetration — that PyPI name is an unrelated math package. Use tet-py / import tet.

Quick start

Prerequisites

  • Python 3.11+
  • Rust 1.95+ (.mise.toml pins rust = "1.95", or install matching rustup toolchain; native/Cargo.toml sets rust-version = "1.95")
  • maturin (pip install maturin or uv tool install maturin)

Development

cd ~/Code/tet-py
uv sync --extra dev
mise run develop   # or: uv run maturin develop
uv run python -c "import tet; print(tet.__version__, tet.core_version())"
uv run pytest -q
uv run mypy python/tet

Links tetration 0.1.12 from crates.io. Test fixtures live in tests/fixtures/.

Example

import tet

with tet.open("tests/fixtures/large.tet") as f:  # or any .tet path
    print(f.mean("a"), f.quantile("a", 0.5))
    r = f.mean("a", preview=32)                   # QueryResult: r.scalar + r.preview (ndarray)
    arr = f.read_numpy("a")                         # ram
    z = f.transform.to_numpy.zscore("a")            # transform → ram
    spill = f.transform.to_spill.zscore("a", path="a_zscore.bin")
    same = spill.to_numpy()                         # transform → spill → ndarray
    side = f.transform.to_sidecar.zscore("a", path="a_zscore.tet")
    same = side.to_numpy(f)                         # transform → sidecar .tet → ndarray

Operations reference (every op with examples): docs/operations.md

Topic Where
mean, min, quantile, histogram, … docs/operations.md
NumPy ram / spill / sidecar docs/operations.md#read_numpy
build_query, selection_slices docs/operations.md#selection-and-build_query
Wire schema / CLI tetration query engine
All docs docs/README.md

info() / summary()

Both return the full tet info --json dict (superblock, datasets, all chunk rows, metadata). For exploration, prefer list(f), f.dataset(name), or info["datasets"] — not printing the whole dict in the REPL.

Project layout

tet-py/
  pyproject.toml      # PEP 621 + maturin
  python/tet/         # public API + _core, _query, _io, _transform
  native/             # PyO3 extension (links tetration 0.1.12)
  tests/fixtures/     # vendored .tet fixtures for CI
  docs/               # operations.md, HANDOFF.md
  CHANGELOG.md

Roadmap

  • Scaffold: maturin, tet.open, datasets, query (JSON document)
  • query() / execute(raw=False) → QueryResult
  • summary() / info() — dict parity with tet info --json
  • Reduction helpers (mean, sum, min, max, …)
  • quantile, histogram, covariance, correlation
  • build_query, axis_slice, selection_slices
  • Dataset, iter_datasets(), f[0] / f["name"], axis index or dim_names
  • UnknownDatasetError / UnknownAxisError; optional typing_stub()
  • mypy + _native.pyi
  • NumPy read — ram (read_numpy, Dataset.to_numpy, transform.to_numpy)
  • NumPy read — spill (read_spill, transform.to_spill, .to_numpy() loaders)
  • NumPy read — sidecar (transform.to_sidecar, SidecarTransformResult.to_numpy)
  • NumPy write (TetWriter, write_dataset)
  • PyPI wheels (tet-py 0.1.1); tetration pin now 0.1.12 on crates.io
  • Query preview samples (preview=N, QueryResult.preview) — #7
  • CI fixtures vendored in tests/fixtures/ (no sibling tetration checkout) — #6

To do

Near-term

  • Pre-bump stack (THI-452) — CI mypy, budgets, TOML, tests, convert npy scaffold
  • Pin tetration 0.1.12 (THI-457) — read_numpy preflight (THI-23), f16/u32/u64 export (THI-15), f64_row_major writer
  • Integer / f16 write_dataset dtypes (THI-26)
  • tet.convert full extras (THI-22) — h5/netcdf/zarr/csv/parquet implementations (stubs + extras exist; Rust CLI remains fast path)
  • Zero-copy mmap → NumPy (THI-21) — views over mmap’d raw payloads (P2)

Docs

License

Dual-licensed under MIT OR Apache-2.0, same as tetration.

Metadata

Release files for tet-py 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tet-py 0.1.2
File Size Uploaded
tet_py-0.1.2.tar.gz 46.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tet-py 0.1.2
File
tet_py-0.1.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
tet_py-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
tet_py-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
tet_py-0.1.2-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.11 abi3 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details

Total release size: 6.5 MB

Release files / tet_py-0.1.2.tar.gz

Download URL tet_py-0.1.2.tar.gz
Size 46.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3e39080fb4ae70062ce4d2caaf0c28b7bc2ed0efa41f07629dc92380b712893b
BLAKE2b-256 checksum
How to use checksums
1c2cd58f32dd53ac23cdab5b5da348de0b7ed3c04a9d76c6d962f3ece2372353
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / tet_py-0.1.2-cp311-abi3-win_amd64.whl

Download URL tet_py-0.1.2-cp311-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4388e024bd5673689e15b80581e623c27225b463aa1093d90ed9b90725751853
BLAKE2b-256 checksum
How to use checksums
aa0b28eb8a185d17a4a40686e744c6e6e9dea27b45439eb28e69371e3dd92a16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / tet_py-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tet_py-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
62c1e5f84f5df631559bb6cc32e8e63d3dd437294349700dc6036ad99c7ba1fa
BLAKE2b-256 checksum
How to use checksums
3e146607779ed6e08a14dbe073fac6961599126f8941105a6f84a27fab9a3539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / tet_py-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tet_py-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
e9d12963c0f46dab36f09bd4ab838c7cf59aef1212dd4bc2abc87bc26dd65a5f
BLAKE2b-256 checksum
How to use checksums
0f6e010f1fc7a289cf193e679932d3b74af4c4ccc6e13395d65e16783bbc7b9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / tet_py-0.1.2-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL tet_py-0.1.2-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.5 MB
Tags CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
30964b3a529562cb05479327093b8861fa664af698a882418387c091073a5f03
BLAKE2b-256 checksum
How to use checksums
7d5fee47922139d277f8cba323f2304923e5a33293c75a2e1fef599775862c34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release history Release notifications | RSS feed

0.2.2

5 release files

0.2.1

5 release files

0.2.0

5 release files

This release

0.1.2 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page