Python client
The Python client (pip install varta) is a first-class peer of the
Rust varta-client crate. It tracks the same wire-format contract,
passes the same tools/vlp-test-vectors.json conformance suite, and
interoperates with the same varta-watch observer binary.
Install
pip install varta # base client (stdlib only)
pip install 'varta[secure]' # adds secure-UDP via `cryptography`
Requires Python 3.8+. Runs on Linux and macOS. The base install carries
zero third-party dependencies; the secure extra pulls in
cryptography for the
ChaCha20-Poly1305 AEAD primitive.
20-line example
import time
from varta import Varta, Status, DropReason
with Varta.connect("/run/varta/varta.sock") as agent:
while True:
outcome = agent.beat(Status.OK)
if outcome.is_dropped:
# Four-way taxonomy mirrors the Rust client:
assert outcome.reason in {
DropReason.KERNEL_QUEUE_FULL,
DropReason.NO_OBSERVER,
DropReason.PEER_GONE,
DropReason.STORAGE_FULL,
}
time.sleep(0.5)
For UDP and secure-UDP transports, fork-safety, the panic-hook family,
and the full parity matrix see the package README in the repo:
clients/python/README.md.
Transports
| Transport | Status | Notes |
|---|---|---|
| Unix Domain Sockets | Supported | Varta.connect(path). Classified BeatOrigin::KernelAttested only on observer platforms with pathname-UDS peer credentials; macOS observers treat pathname UDS as socket-mode-only, so recovery is refused. |
| Plaintext UDP | Supported | Varta.connect_udp((host, port)). Connected-mode socket. Beats classified NetworkUnverified; recovery refused. |
| Secure UDP (ChaCha20-Poly1305) | Supported | Varta.connect_secure_udp((host, port), key). Requires pip install 'varta[secure]'. |
| Master-key secure UDP | Supported | Varta.connect_secure_udp_with_master((host, port), mkey) |
Stability
- Wire format: VLP v0.2, governed by the spec.
- Python API: independent semver, tracked in
clients/python/CHANGELOG.md.