Skip to main content

Python SDK

Status: live. The Python SDK is zeq.py — a single file, standard library only (no pip, no PyPI, no dependencies), served and versioned by every Zeq origin itself, exactly like the zeq CLI. Python 3.8+.

Install (one file — no pip)

curl -fsSO https://zeqsdk.com/cli/zeq.py

That's the whole install. The framework's download channel is its own origin — no external registry in the loop.

Quickstart

from zeq import Zeq

z = Zeq("https://zeqsdk.com", key="zeq_ak_...") # or: z = Zeq(); z.demo_key()

# The clock — current Zeqond + phase (canonical floor(unix_ms / 777))
p = z.pulse()
print(p["zeqond"], p["phase"])

# Compute — KO42 (the 1.287 Hz carrier) is added automatically
env = z.compute("NM19", mass=5, acceleration=2)
print(env["result"]["value"]) # 10

# Verify the receipt — Ed25519 against the origin's published node key
# PLUS an independent recompute via the verifier mesh
att = z.verify(env)
print(att["attestation"]["verdict"]) # "agree"

The domain is inferred from the operator prefix (QM… → quantum-mechanics, NM… → classical-mechanics, GR… → general-relativity, …) or pass domain="..." explicitly.

It's also a command

ZEQ_ORIGIN=https://zeqsdk.com python3 zeq.py pulse
python3 zeq.py demo-key
python3 zeq.py compute GR37 mass=1.98892e30 > sun.json
python3 zeq.py verify sun.json

ZEQ_ORIGIN and ZEQ_KEY environment variables configure the default client.

API surface

MethodWhat it does
Zeq(origin, key=None)Client for one origin (any fork — yours included).
z.pulse()Current Zeqond, phase, HulyaPulse status.
z.operators(search=None)The operator catalogue (1,500+ catalogued).
z.demo_key()Mint a free demo key (rate-limited) and adopt it.
z.compute(*ops, domain=None, **inputs)Run operators; returns the full signed CKO envelope.
z.verify(envelope)Both trust legs server-side: Ed25519 signature + independent recompute. Returns the attestation.
z.node_identity()The origin's published Ed25519 node identity.

Errors raise ZeqError with .status and the node's JSON payload attached — the node's message, never [object Object].

Verification note (honesty section)

z.verify() submits the signed claim to POST /api/attest, where the node checks the Ed25519 signature against the origin's published key and re-runs the computation independently through the verifier mesh. Local in-process signature checking is deliberately not included in the stdlib build: Python's standard library has no Ed25519, and JSON float canonicalization differs between JS and Python — a local check that "usually works" is worse than an attested one that always tells the truth. For fully offline verification, use the zero-dependency verifier script or zeq verify (the CLI does the local Ed25519 leg via WebCrypto).

Other languages

Everything zeq.py does is plain HTTPS + JSON: POST /api/zeq/compute with a Bearer key, POST /api/attest to verify. Any language with an HTTP client is a first-class citizen — and any language can shell out to zeq … --json, which returns typed JSON with honest exit codes (0/1/2/127). Run zeq sdk for snippets wired to your key and origin.