Skip to main content

ccht for Python

The same Rust conversation model used by ccht's native and Wasm consumers, available as pip install ccht. Python 3.10 or newer is required.

from ccht import Conversation

chat = Conversation("creator")
changed = chat.apply_event({
    "version": 1,
    "conversation_id": "creator",
    "request_id": "turn-1",
    "sequence": 1,
    "event": {
        "kind": "update",
        "update": {
            "sessionUpdate": "agent_message_chunk",
            "content": {"type": "text", "text": "Hello"},
        },
    },
})
assert changed
assert chat.snapshot()["turns"][0]["text"] == "Hello"

Conversation.apply_event() accepts a JSON string or mapping and returns whether it changed the model. Replayed events return False. A wrong conversation, sequence gap, invalid envelope, or event after completion raises ConversationError (a ValueError subclass) without changing the state. snapshot() returns a detached dictionary; snapshot_json() returns its JSON. Tool calls, permissions, thought and non-text content retain the same wire contract as the Rust and Wasm packages. Sequence numbers start at one per request.

This package binds the portable model through PyO3. It does not expose the Rust native process host. Your application connects to an authorized host, delivers its ccht events, and owns UI, prompts, persistence, transport and authorization. Use the Rust ccht::native API to host installed Codex, Claude or OpenCode ACP executables. No agent, credentials, provider HTTP client or paid fallback is included in the Python package.

The first binary wheel targets Linux x86-64 (glibc 2.34 or newer) with CPython's stable ABI. Other platforms build the source distribution with a compatible Rust compiler, C linker, Python development headers and the declared maturin build backend. Only platforms exercised by release CI are claimed as tested.

License and source replacement

ccht is LGPL-3.0-only WITH LGPL-3.0-linking-exception. Both LGPL and GPL texts and upstream notices accompany the distributions. The wheel includes its corresponding source distribution at ccht/source/ccht-<version>.tar.gz; PyPI also serves it separately. It contains the binding, exact published Rust ccht source, every locked Cargo dependency and Cargo's vendor configuration. No application source is part of this kit.

To rebuild and replace the extension, extract that archive, make your changes, then run python -m pip wheel --no-deps . and install the resulting wheel into your application's environment. Cargo can build without registry access using the supplied vendor directory (CARGO_NET_OFFLINE=true). Python build tools and the compiler are separate prerequisites. CI also rebuilds the extracted source with an empty Cargo cache and runs the same independent consumer against the replacement. This proves source replacement, not byte-identical compilation.

Release builds use maturin's ABI audit with the actual Rust target. On Nix, the release check removes the extension's build-host RPATH with patchelf and repacks it with the standard wheel tool before testing. This changes no ABI tags or bundled source. Build the source directly on your own platform to use its normal linker configuration.

Keep the notices, corresponding source and users' replacement rights when distributing applications with ccht. Product licensing and installation must permit the applicable LGPL replacement/debugging rights; consult the included license texts for the actual terms.

Metadata

Release files for ccht 0.3.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 ccht 0.3.2
File Size Uploaded Provenance Actions
ccht-0.3.2.tar.gz 9.3 MB Without provenance Details for ccht-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ccht 0.3.2
File Interpreter ABI Platform Actions
ccht-0.3.2-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details for ccht-0.3.2-cp310-abi3-manylinux_2_34_x86_64.whl

Total release size: 19.8 MB

Release files / ccht-0.3.2.tar.gz

Download URL ccht-0.3.2.tar.gz
Size 9.3 MB
Tags Source
SHA-256 checksum
How to use checksums
2384d149dfc2b7950730e64b02a1fbae6fe4577b6659e72c22b446cd9e361dd2
BLAKE2b-256 checksum
How to use checksums
dcb593e5d45b132c74044e9f446c95601218d45e59629de51321c8ad3427bbcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ccht-0.3.2-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL ccht-0.3.2-cp310-abi3-manylinux_2_34_x86_64.whl
Size 10.4 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
cf173e578dcbf96ec1fdf7939c88ba9133888b295dfba8ba59aa5a1e51d7783d
BLAKE2b-256 checksum
How to use checksums
08d5aefa6d1b6d8e93f55ad853acbdfa4de080942eca0e1eec431af1bdc2fea9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ccht 0.3.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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