Deploy from Python
Publish Python datasets to hypequery cloud with a deployment bundle and the hypequery CLI.
hypequery cloud is not live yet
Python projects write a deployment bundle with the Python SDK, then release and submit it with the TypeScript
hypequery CLI (npx hypequery). The Python CLI scaffolds and serves projects locally; cloud
releases go through the Node.js CLI.
1. Write a deployment bundle
# analytics/cloud.py
from hypequery.datasets import create_dataset_registry, write_dataset_bundle
from .orders import orders
write_dataset_bundle(
"analytics/hypequery-deployment",
create_dataset_registry(orders),
endpoints={
"orders": {
"access": {"kind": "authenticated", "roles": ["analyst"], "scopes": []},
"tenant": {"kind": "not-required"},
"path": "/api/analytics/datasets/orders/query",
},
},
)Each entry in endpoints publishes one dataset with its access policy, tenant requirement, and path.
To publish business context in the same release, pass
business_context=define_business_context(...) (from hypequery.datasets). The bundle then carries
business-context.json, with the bytes and identity hypequery deploy gives the same context.
2. Log in, release, and submit
python -m analytics.cloud
npx hypequery login
npx hypequery deployment:release analytics/hypequery-deployment
npx hypequery deployment:submit analytics/hypequery-deployment \
--release analytics/hypequery-deployment.release.jsondeployment:releasebinds the bundle to your project and environment and writes the release beside the bundle.deployment:submituploads both. Once cloud accepts the release, check where it is served withnpx hypequery deployment:status.
A one-step publish_to_cloud helper for Python, matching TypeScript's publishToCloud, is planned.