Compute SDK¶
What does it do?¶
The Compute SDK lets you run your Compute.build apps from Python, outside the web platform. You point it at your Compute Engine, send one or many sets of inputs, and get the results back as data you can batch, analyse, or plot.
Common uses: run an app across a range of inputs, pull the results into a chart or spreadsheet, or drive apps from your own scripts.
New to Python? The quickest start is to open one of the example notebooks and run it — you don't need to write anything from scratch.
How to use?¶
Prerequisites¶
- Windows 10/11 with the Compute Engine installed and running.
- Python 3.11.
- An API key.
Installation¶
- Download the SDK here and extract it.
- Install it into your Python environment (run this from the folder that contains
the extracted
compute-sdk):This installs thepip install ./compute-sdk # or: uv pip install ./compute-sdkcompute_sdkpackage, soimport compute_sdkworks from anywhere.
Info
We recommend installing into a virtual environment.
Usage¶
Make sure the Compute Engine is running, then:
from compute_sdk.clients.engine.compute_client_engine import ComputeClientEngine
from compute_sdk.clients.engine.data_objects import ComputeAppRequest
# 1. Connect to the engine with your API key
engine = ComputeClientEngine(api_key="YOUR_API_KEY")
# 2. Choose the app, your collection, and one or more sets of inputs
request = ComputeAppRequest.from_data(
app_name="EC3_Steel_Column_Axial", # the app's entry class
collection_uuid="YOUR_COLLECTION_UUID",
input_args=[{"L": length} for length in range(2000, 10000, 100)],
)
# 3. Solve and read the results
results = engine.solve_app(app_request=request)
for result in results:
if result.status == 200 and not result.logging: # this run succeeded
print(result.results_payload)
app_nameis the app's entry class; find yourcollection_uuidon the platform under Settings → Profile.- Each entry in
input_argsis one run — pass many to solve in a batch. - Each result has
status,logging(empty on success), andresults_payload(a dictionary of the app's result values).
Run a local collection¶
To run an app from a collection on your machine — instead of one deployed to
the cloud — use from_local with the collection folder. No collection uuid is
needed:
from compute_sdk.clients.engine.data_objects import ComputeAppRequest
request = ComputeAppRequest.from_local(
collection_path=r"C:\path\to\your\collection", # folder with collection_requirements.yaml
app_name="EC3_Steel_Column_Axial", # the app's entry class (or its app_dir)
input_args=[{"L": 4000}],
)
results = engine.solve_app(app_request=request)
The Engine reads the collection from disk, so collection_path must be a folder the
Engine can reach. You still connect with your API key, exactly as above.
Danger
Never share or commit your API key. Keep it out of notebooks and version control that others can see. See API Keys.
Examples¶
The download includes runnable notebooks in its examples/ folder. You can also open
them directly:
solve_app_example.ipynb— connect, run an app across a range of inputs, and plot the results.solve_app_ec4_design_column.ipynb— a worked example driving a design app.
The notebooks need a few extra packages. From the compute-sdk folder, install them
and launch Jupyter:
pip install jupyterlab python-dotenv pandas plotly matplotlib
jupyter lab