Skip to main content

Python Framework

Zeq provides two Python libraries: an offline framework for local computation and an online client that calls the Zeq API.

Installation

Download both from zeq.dev/sdk/downloads/python/.

Offline: hulyas_framework.py

Run computations locally without an API key or internet connection.

from hulyas_framework import HulyasFramework

fw = HulyasFramework()
result = fw.compute("escape velocity from Mars")
print(result)
# {'value': 5027.0, 'unit': 'm/s', 'operator': 'NM21+NM23',
#  'equations': [...], 'master_sum': 42.0, 'precision': '0.05%'}

Online: zeq_client.py

Call the Zeq API for server-verified results with ZeqProof receipts.

from zeq_client import ZeqClient

client = ZeqClient(api_key="YOUR_API_KEY")
result = client.compute("gravitational force Earth-Moon")
print(result['value'])      # 1.98e+20
print(result['unit'])       # N
print(result['zeqProof'])   # verification hash

Key Differences

FeatureOfflineOnline
Internet requiredNoYes
API key requiredNoYes
ZeqProof receiptNoYes
KO42 verificationYesYes
All 42+ operatorsYesYes

Related

Python Client Docs · Compute API · Quickstart