Skip to main content

Python bindings for the theta CLI

Project description

theta-py

Python bindings for the theta CLI.

A thin wrapper around the theta binary. Every verb is exposed as a typed Python function. Pydantic models for arguments and outputs are codegenerated from the schemas the binary itself emits, so theta-py cannot drift from the binary it ships.

Install

uv add theta-py
# or
pip install theta-py

The matching theta binary is bundled inside the wheel and lands at <venv>/bin/theta when the package is installed (unless your platform is not supported and the binary will be built locally as per theta installer)

Use

Two equivalent surfaces.

# namespaced, one singleton, dotted access
from theta_py import theta

theta.init(name="my-agent")
theta.add.rule("safety")
listing = theta.list.rules()
print(listing.kind)
# flat, every verb is a top-level function
from theta_py import init, add_rule, list_rules

init(name="my-agent")
add_rule("safety")
listing = list_rules()

Pydantic outcome types are importable for type-hint use:

from theta_py import theta
from theta_py._generated.outcomes import InitOutcome, CheckOutcome

out: InitOutcome = theta.init(name="my-agent")
report: CheckOutcome = theta.check()
assert report.valid

Errors

Every verb either returns a pydantic model on status: ok|noop, or raises ThetaCommandError on status: error:

from theta_py import theta, ThetaCommandError

try:
    theta.init()
except ThetaCommandError as exc:
    print(exc.verb)          # ["init"]
    print(exc.diagnostics)   # list of {"level": ..., "path": ..., "message": ...}

Catch ThetaInvocationError to handle any failure (transport + envelope).

Version pinning

theta_py.THETA_VERSION is the version of the theta binary bundled inside the wheel. Each theta_py release ships against exactly one theta release.

import theta_py
print(theta_py.THETA_VERSION)  # e.g. "0.1.3-rc1"

Releases

See RELEASING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

theta_py-0.0.3-py3-none-win_amd64.whl (4.3 MB view details)

Uploaded Python 3Windows x86-64

theta_py-0.0.3-py3-none-manylinux_2_28_x86_64.whl (5.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

theta_py-0.0.3-py3-none-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

theta_py-0.0.3-py3-none-macosx_11_0_x86_64.whl (4.8 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

theta_py-0.0.3-py3-none-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file theta_py-0.0.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: theta_py-0.0.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for theta_py-0.0.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 612cb49cc007d192761a03858e7962c6ad20265c1fa4e462ed8c02017c89600a
MD5 efa9e60fa15d6fed9fa7f3ff5ebcc9f5
BLAKE2b-256 5c86855e7ddadb274aa8f43134b5851329373b283189aec78bd849da21f1ba68

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.3-py3-none-win_amd64.whl:

Publisher: release.yml on tamarillo-ai/theta_py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file theta_py-0.0.3-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7ab409207767fb47f37eee3f85d15a0806c1f1eed454a338b018183c4c2e7472
MD5 3259c11ffc82737289b26492b362e70e
BLAKE2b-256 4a6029aba9d6fa642f33eb31eca2e4ccee7d18731725cf2f5e7425fb595e80e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.3-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on tamarillo-ai/theta_py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file theta_py-0.0.3-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cb03f63d66d4aa7d14f6b60fb4dd923d48f9a88a481723129e41431e07a43272
MD5 20f97b19b81431e8d2a33c9c9f789e8d
BLAKE2b-256 2eadd007534380697223792437298d7fb27febcea1df791502e17060008df026

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.3-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on tamarillo-ai/theta_py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file theta_py-0.0.3-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.3-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0eb81983e646e156d61e3157a8c35214d023671d8152f523e3f00a94d6694171
MD5 b17d193922272dae2de389b1d0d355f2
BLAKE2b-256 a7494c69b2a0233c4b9363855fe02e7cf614d92fc7751ec6f43ea4b3e328cb54

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.3-py3-none-macosx_11_0_x86_64.whl:

Publisher: release.yml on tamarillo-ai/theta_py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file theta_py-0.0.3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d4e81846671f3c42a29c5b5e2d533c8ff02e468caefd9f9a6c60c7ca5969fbaa
MD5 61fa2e2a64a2fd1b838b4be9de474937
BLAKE2b-256 aa7afd64910606b77b08e20d43cd39132c654b1caa44176634f161d2605f4d16

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.3-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on tamarillo-ai/theta_py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page