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. 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.

Release files for ccht 0.2.1

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.2.1
File Size Uploaded
ccht-0.2.1.tar.gz 10.7 kB Details

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / ccht-0.2.1.tar.gz

Download URL ccht-0.2.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
31c34f885d02e2b05887f3a5aca131bc3be8c5f7420ed2385d3d65b43e65a717
BLAKE2b-256 checksum
How to use checksums
51bb6c6cae8061e50ca346930dc25bf7757c212d5ef809a111ca42c37b7f002b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.2.1-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL ccht-0.2.1-cp310-abi3-manylinux_2_34_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
c9ef267a3b3d8caf1d02aa7daefce7af78032138ccf59214737283bca16fb4d3
BLAKE2b-256 checksum
How to use checksums
d3de782b08f2fc92ad9ec6cdda20f85f4de263cdf26cc11eca4fd9f635b687ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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 history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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