Python SDK
Status: early access. The Python client is scaffolded in app/sdk/python/ and covers the hosted API surface. Not yet published to PyPI; install from source.
Install from source
git clone https://github.com/hulyasmath/zeq-framework
cd zeq-framework/app/sdk/python
pip install -e .
Quickstart
import os
from zeq import Zeq
zeq = Zeq(api_key=os.environ["ZEQ_API_KEY"])
# Read pulse
p = zeq.pulse()
# {"zeqond": 72380021.4, "phase": 0.412, "f_hz": 1.287, "T_s": 0.777, "R_t": 0.999917}
# Hosted compute (signed CKO)
result = zeq.compute(
domain="quantum_mechanics",
inputs={"frequency": 5e14},
)
print(result.value, result.unit)
# 3.3126157e-19 J
print(result.ko42)
# {"mode": "KO42.1", "alpha": 0.00129, "error_band": 4.3e-4, "within_bound": True}
print(result.signature)
# ed25519:...
Parity with the TypeScript SDK
The Python client is a thin wrapper over the hosted API. The function names match the TypeScript SDK:
| TypeScript | Python |
|---|---|
pulse() | zeq.pulse() |
unixToZeqond(t) | zeq.unix_to_zeqond(t) |
zeqondToUnix(z) | zeq.zeqond_to_unix(z) |
ZeqClient().compute(...) | Zeq(...).compute(...) |
ZeqMailClient | zeq.mail(...) |
ZeqMeshClient | zeq.mesh(...) |
What's missing
- Local compute. The Python SDK currently routes every
compute()call through the hosted API. The TypeScript SDK can compute the 42-operator catalogue locally; the Python port is planned but not implemented. - PyPI publication. Install from source today; PyPI release targeted for the next framework minor version.
- Async client. Current client is synchronous; an
AsyncZeqclass is on the roadmap.
Contributing
The Python SDK is the highest-value open-source contribution right now. If you want to help:
- Port the
solvers.tsoperator catalogue to Python (closest to TensorFlow-class work — clean numerical code). - Port the
mail.ts,mesh.ts,daemon.tsvertical clients (straightforward — wrap HTTP endpoints). - Add
pytestcoverage for the full protocol registry.
See Contributing for the PR workflow.