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.2-py3-none-win_amd64.whl (4.4 MB view details)

Uploaded Python 3Windows x86-64

theta_py-0.0.2-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.2-py3-none-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ x86-64

theta_py-0.0.2-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.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: theta_py-0.0.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.4 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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c9b569d7f943218a5fabe88cf176867af431be45f843b45a369f1b961c4064cd
MD5 6e518351daf88e00ef397590fec896af
BLAKE2b-256 5a2ae67faecea90c683f0ff60774124dbc5408d40ad577dadedaad851b371da7

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.2-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.2-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 06ced1768a008491fd3dbf19c486eaaaffda021a73551a278adf598bf726d1e0
MD5 d7ba5b6268d3cb631e0a5010ab857902
BLAKE2b-256 4e84118c49b95abbd5c035234a549bcdd6560a3d4ae949b66c840e958fdf5a73

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.2-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.2-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 671250b8ef8bf3ec15e296860887b5253215edcacb5ee069f596ded7905fe084
MD5 d0be0c98f941e1a6b73948917083334b
BLAKE2b-256 493989a78fce3c43114bdcd4e90df2b4f018fc79a22beff43a4fa325d3be2356

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.2-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.2-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.2-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 465b5e15ffe682e94a7b0e41c95ce9c9bc9ddcf74e8c996ad3710ab2355ba0ff
MD5 d974249dccdb7cfd86bda18a1eab70ad
BLAKE2b-256 ebd8843a5a0a102a2f2fa60500b63eb9112eb99b4ae04fb39c881fa00a4de69e

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.2-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.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for theta_py-0.0.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4ad80885b0c52ae37756b705c661423d49a98d4f59992d0b6992cd81bf036dd
MD5 f431fdc726c021af944d1cccabf8291c
BLAKE2b-256 e42322eb16fc3df993b5e761ca72777aaf11cae2ea67bfda58d0eca4045fc394

See more details on using hashes here.

Provenance

The following attestation bundles were made for theta_py-0.0.2-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