Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

thadam-python

Python SDK for the Thadam edge capture runtime, built with PyO3 and maturin.

  • thadam.validate(path) — validate a pipeline configuration, returning every error and warning with positions and hints.
  • thadam.config_hash(path) — the stable configuration hash the runtime records in thadam.json.
  • thadam.read_segments(sink_dir, dataset=None) — read a Parquet sink's ready segments into a pyarrow.Table, zero-copy over the Arrow PyCapsule interface.
  • thadam.Pipeline(path) — build and run a pipeline in-process on a Rust-owned Tokio runtime, with the GIL released and graceful shutdown from another thread via stop().

Requirements

  • Python >= 3.9, pyarrow >= 14 (installed as a dependency)
  • Rust toolchain matching the workspace (rust-toolchain.toml) for building from source
  • A CPython build available to PyO3: any python3 on PATH when building from a checkout (PYO3_PYTHON to pick a specific one)

Building from a checkout

cd sdk/python
python3 -m venv .venv
. .venv/bin/activate
pip install maturin pytest pyarrow
maturin develop
pytest tests

maturin develop builds the thadam._native cdylib with pyo3/extension-module (no libpython linked) and installs the package in the virtualenv. Cargo's plain cargo test -p thadam-python builds without that feature (rlib + libpython) so the Rust unit tests run too.

Examples

Validate a configuration

import thadam

for d in thadam.validate("pipeline.yaml"):
    where = f":{d.line}:{d.column}" if d.line else ""
    print(f"{d.severity}[{d.code}] {d.path}{where}: {d.message}")
    if d.hint:
        print(f"  hint: {d.hint}")

The configuration hash

assert thadam.config_hash("pipeline.yaml") == "1734a596e8a251683f1e829377f1e2c5"

Read a Parquet sink

table = thadam.read_segments("/var/lib/thadam/sinks/local", dataset="readings")
print(table.schema)
print(table.num_rows)
df = table.to_pandas()

read_segments lists files through the sink's catalog.log when one exists (every record that still has a file on disk, oldest WAL range first) or walks ready/ directly when there is no catalog (fixtures, copied-out data). All files must share a schema — they do when one sink wrote them.

Run a pipeline in-process

import threading

import thadam

pipeline = thadam.Pipeline("pipeline.yaml")
t = threading.Thread(target=lambda: print("exit", pipeline.run(timeout=300)), daemon=True)
t.start()
# ... other work ...
pipeline.stop()   # graceful shutdown, like SIGINT to the CLI
t.join()
exit_code = pipeline.run(timeout=300)  # raises: a Pipeline runs once

run(timeout=seconds) triggers graceful shutdown when the timeout elapses (the shutdown deadline then bounds the drain); it is not a hard kill. Exit codes mirror the CLI: 0 clean, 1 runtime failure, 2 invalid configuration, 3 data directory, 130 interrupted.

Catching errors

try:
    h = thadam.config_hash("missing.yaml")
except thadam.ThadamError as e:
    print(e.code, e.domain)  # config.invalid config
    print(e.message)

Arrow versions

The workspace writes segments with arrow/parquet 60, while pyo3-arrow 0.19 (the newest release) pairs with arrow 59 — no release tracks arrow 60 yet. read_segments therefore opens the Parquet files itself with parquet 59 and hands the batches to pyo3-arrow; the decode types never cross between majors, and the Python-side transfer stays zero-copy through the Arrow C stream capsule. When pyo3-arrow publishes an arrow-60 release this constraint goes away. One wheel per platform covers all supported Pythons via PyO3's abi3 (abi3-py39); pyo3-arrow's capsule and buffer-protocol APIs are stable-ABI-safe.

Layout

sdk/python/
  Cargo.toml            Rust crate `thadam-python`, cdylib `thadam`
  pyproject.toml        maturin build, Python >= 3.9, abi3 wheel
  src/                  PyO3 bindings and Rust unit tests
  python/thadam/         pure-Python package (re-exports, .pyi stubs, py.typed)
  tests/                pytest suite (run inside a venv, see above)

Metadata

Release files for thadam 0.1.0b1

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

Source distribution (sdist)

Source distribution for thadam 0.1.0b1
File Size Uploaded Provenance Actions
thadam-0.1.0b1.tar.gz 1.1 MB With provenance Details for thadam-0.1.0b1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for thadam 0.1.0b1
File Interpreter ABI Platform Actions
thadam-0.1.0b1-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for thadam-0.1.0b1-cp39-abi3-manylinux_2_28_x86_64.whl
thadam-0.1.0b1-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details for thadam-0.1.0b1-cp39-abi3-manylinux_2_28_aarch64.whl
thadam-0.1.0b1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for thadam-0.1.0b1-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 87.2 MB

Release files / thadam-0.1.0b1.tar.gz

Download URL thadam-0.1.0b1.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
d7eeda780674a9b7b83114cc83740c24eaeb2bcc0105ca3e63cf7293721cd5f7
BLAKE2b-256 checksum
How to use checksums
958b312a5a83a59302dd04f07b0ba3197e5241e446ada93bb1e758f613c6780d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / thadam-0.1.0b1-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL thadam-0.1.0b1-cp39-abi3-manylinux_2_28_x86_64.whl
Size 38.7 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
45451b0716d8d5c120dbd830abfe3697edd6a642633d19fab9813f0d04af5ffc
BLAKE2b-256 checksum
How to use checksums
c565172647d90052f7f70fd1d731a27f7bc99e03fcb8a5d404e733061554b131
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / thadam-0.1.0b1-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL thadam-0.1.0b1-cp39-abi3-manylinux_2_28_aarch64.whl
Size 36.0 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
385bdc5a56dd59dcf1aaf4f45c28a4d3a2a8f08630c9e9b2e240117d8f9c7741
BLAKE2b-256 checksum
How to use checksums
65f972f082f058fe2e05a67a93d67683cf059f4e3276ad1c40fc3e08577bc284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / thadam-0.1.0b1-cp39-abi3-macosx_11_0_arm64.whl

Download URL thadam-0.1.0b1-cp39-abi3-macosx_11_0_arm64.whl
Size 11.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b658cb4c53fd37f796fad6b7d1d59d5d67d8420aa5f5b02f382d64a6cc247ab5
BLAKE2b-256 checksum
How to use checksums
3c9880dd828f2069fa9669bf41f9526aa140df2a38c204cfe133da98bf9627cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for thadam 0.1.0b1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for thadam-0.1.0b1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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