Python
Use the Cells HTTP API from Python. No published PyPI package exists yet.
Note
No PyPI package has been published. Use the REST API directly with
requests or any HTTP client, or generate a typed client from the OpenAPI spec.HTTP example
Python (requests)
import os, requests
API_KEY = os.environ["CELLS_API_KEY"]
PROJECT_ID = os.environ["CELLS_PROJECT_ID"]
BASE = "https://api.mudbase.dev/api/sandboxes/projects/" + PROJECT_ID
HEADERS = {"x-api-key": API_KEY, "Content-Type": "application/json"}
resp = requests.post(BASE, json={
"language": "python",
"languageVersion": "3.12",
"timeoutSeconds": 300,
}, headers=HEADERS)
session_id = resp.json()["sessionId"]
print(session_id)import os, requests
API_KEY = os.environ["CELLS_API_KEY"]
PROJECT_ID = os.environ["CELLS_PROJECT_ID"]
BASE = "https://api.mudbase.dev/api/sandboxes/projects/" + PROJECT_ID
HEADERS = {"x-api-key": API_KEY, "Content-Type": "application/json"}
resp = requests.post(BASE, json={
"language": "python",
"languageVersion": "3.12",
"timeoutSeconds": 300,
}, headers=HEADERS)
session_id = resp.json()["sessionId"]
print(session_id)Generate a typed client
openapi-generator
openapi-generator-cli generate \
-i https://docs.cells.mudbase.dev/openapi.yaml \
-g python \
-o ./cells-clientopenapi-generator-cli generate \
-i https://docs.cells.mudbase.dev/openapi.yaml \
-g python \
-o ./cells-client