Python bindings for the theta CLI
Project description
theta-py
Python bindings for the theta CLI.
Install
uv add theta-py
# or
pip install theta-py
ThetaProject
The main surface. Owns a materialized theta project in a temp directory.
The equivalent of this CLI workflow:
theta init
theta add rule python-types
theta add tool fetch --command "uvx mcp-server-fetch"
theta add tool context7 --command "npx -y @upstash/context7-mcp@latest"
theta add skill vercel-labs/agent-skills/skills/web-design-guidelines@main
theta check
theta cast to claude-code
is this:
from theta_py import ThetaProject
with ThetaProject.create(name="my-agent") as proj:
proj.add.rule("python-types")
proj.add.tool("fetch", command="uvx mcp-server-fetch")
proj.add.tool("context7", command="npx -y @upstash/context7-mcp@latest")
proj.add.skill("vercel-labs/agent-skills/skills/web-design-guidelines@main")
proj.check() # raises ThetaCommandError on validation errors
proj.cast.to("claude-code") # --> CLAUDE.md + .mcp.json + .claude/
proj.sync()
print(proj.name) # str
print(proj.system_prompt) # str | None
print(proj.rules) # dict[str, MaterializedRule]
print(proj.skills) # dict[str, MaterializedSkill] — .path is the materialized dir
print(proj.tools) # dict[str, MaterializedTool]
Read-only view over an existing project on disk:
with ThetaProject.from_manifest("path/to/theta.toml") as proj:
# sync() is done eagerly by default
print(proj.name)
print(proj.skills)
# opt out of eager sync
with ThetaProject.from_manifest("path/to/theta.toml", no_sync=True) as proj:
proj.sync()
print(proj.skills)
Sync freshness:
with ThetaProject.create(name="my-agent") as proj:
proj.add.rule("safety", content="Never exfiltrate data.")
proj.sync()
proj.add.rule("style", content="Be concise.") # manifest changed
print(proj.needs_sync()) # True
proj.sync(validate=False)
print(proj.is_synced) # True
Notes:
ThetaProject.create(...)is the canonical constructor for ephemeral projects.ThetaProject.from_manifest(...)never writes to the source tree:.theta/andtheta.lockare redirected into an internal temp directory.proj.skills[name].pathis the materialized.theta/skills/name/directory — pass it directly toharbor run --skill.- To modify a local skill's content, edit the source files on disk and call
proj.sync()again.
Lower-level use
Every verb is also available as a flat function or via the theta singleton:
# namespaced singleton
from theta_py import theta
theta.init(name="my-agent")
theta.add.rule("safety")
listing = theta.list.rules()
# flat functions
from theta_py import init, add_rule, list_rules
init(name="my-agent")
add_rule("safety")
list_rules()
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[{"level": ..., "path": ..., "message": ...}]
Version pinning
Each theta_py release ships against exactly one theta binary version:
import theta_py
print(theta_py.THETA_VERSION) # e.g. "0.1.5-rc1"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file theta_py-0.0.4-py3-none-win_amd64.whl.
File metadata
- Download URL: theta_py-0.0.4-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcbbba6c3a9dac278745ad7c0b3dbe4958a7ed02b371ca2295fa91bae3bbd72f
|
|
| MD5 |
349ae4482fdc981bb24087093820f0dc
|
|
| BLAKE2b-256 |
2b683a179cd65d4cfae465ddcf54e5e6fe13bc396e1e6513e70ea655a0847100
|
Provenance
The following attestation bundles were made for theta_py-0.0.4-py3-none-win_amd64.whl:
Publisher:
release.yml on tamarillo-ai/theta_py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
theta_py-0.0.4-py3-none-win_amd64.whl -
Subject digest:
bcbbba6c3a9dac278745ad7c0b3dbe4958a7ed02b371ca2295fa91bae3bbd72f - Sigstore transparency entry: 1807366166
- Sigstore integration time:
-
Permalink:
tamarillo-ai/theta_py@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/tamarillo-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Trigger Event:
push
-
Statement type:
File details
Details for the file theta_py-0.0.4-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: theta_py-0.0.4-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 5.1 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
703a7eb94da15c49eb5d222b50985c8c8a7f5fda38b7c0f060b14d5a02dd0b2c
|
|
| MD5 |
816973b91f3fc352f9be985df6234f23
|
|
| BLAKE2b-256 |
a09fa6627fc4c642e867db9feff17e2acb49e216ee8cec38e144d5804023ab32
|
Provenance
The following attestation bundles were made for theta_py-0.0.4-py3-none-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on tamarillo-ai/theta_py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
theta_py-0.0.4-py3-none-manylinux_2_28_x86_64.whl -
Subject digest:
703a7eb94da15c49eb5d222b50985c8c8a7f5fda38b7c0f060b14d5a02dd0b2c - Sigstore transparency entry: 1807366103
- Sigstore integration time:
-
Permalink:
tamarillo-ai/theta_py@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/tamarillo-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Trigger Event:
push
-
Statement type:
File details
Details for the file theta_py-0.0.4-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: theta_py-0.0.4-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 5.0 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
902cd2bc9a691fe0b7334ef49acfa6f7dcb34cfd9978579df0ea12e10d547bcc
|
|
| MD5 |
ea0d9a6942534e10666fb9c9c49f862d
|
|
| BLAKE2b-256 |
9d9ffd1de9690ca16d1d083900950ad36dbf560c4b43569fd55646ac87f2c0f5
|
Provenance
The following attestation bundles were made for theta_py-0.0.4-py3-none-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on tamarillo-ai/theta_py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
theta_py-0.0.4-py3-none-manylinux_2_28_aarch64.whl -
Subject digest:
902cd2bc9a691fe0b7334ef49acfa6f7dcb34cfd9978579df0ea12e10d547bcc - Sigstore transparency entry: 1807366062
- Sigstore integration time:
-
Permalink:
tamarillo-ai/theta_py@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/tamarillo-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Trigger Event:
push
-
Statement type:
File details
Details for the file theta_py-0.0.4-py3-none-macosx_11_0_x86_64.whl.
File metadata
- Download URL: theta_py-0.0.4-py3-none-macosx_11_0_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: Python 3, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23c0e60a9759f1a35282e8618618bac5e2dc0dab578d3144b5d9939c4b2cf121
|
|
| MD5 |
3d5f7c71640ee9fa38960e6ca817b10a
|
|
| BLAKE2b-256 |
0d9d59d6e7827adf3eee9a7cf3e27d9530c0c03e8bd43d3e216146dce66d0943
|
Provenance
The following attestation bundles were made for theta_py-0.0.4-py3-none-macosx_11_0_x86_64.whl:
Publisher:
release.yml on tamarillo-ai/theta_py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
theta_py-0.0.4-py3-none-macosx_11_0_x86_64.whl -
Subject digest:
23c0e60a9759f1a35282e8618618bac5e2dc0dab578d3144b5d9939c4b2cf121 - Sigstore transparency entry: 1807366136
- Sigstore integration time:
-
Permalink:
tamarillo-ai/theta_py@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/tamarillo-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Trigger Event:
push
-
Statement type:
File details
Details for the file theta_py-0.0.4-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: theta_py-0.0.4-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ff98070fae2455521a2b506c8a3636e0dbe9622291967359eb34a3e748d263c
|
|
| MD5 |
c037f41b6ee58a13664454673a5405ee
|
|
| BLAKE2b-256 |
d912e8759b403a175719955364bcc5b72c83e5f70ab1e8eb7595a4d0a6ac17e2
|
Provenance
The following attestation bundles were made for theta_py-0.0.4-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on tamarillo-ai/theta_py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
theta_py-0.0.4-py3-none-macosx_11_0_arm64.whl -
Subject digest:
1ff98070fae2455521a2b506c8a3636e0dbe9622291967359eb34a3e748d263c - Sigstore transparency entry: 1807366185
- Sigstore integration time:
-
Permalink:
tamarillo-ai/theta_py@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/tamarillo-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc2757817aed67c4df4fa0b75d5d67ac5e509622 -
Trigger Event:
push
-
Statement type: