Skip to content

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

Installation

  1. Download the SDK here and extract it.
  2. Install it into your Python environment (run this from the folder that contains the extracted compute-sdk):
    pip install ./compute-sdk        # or: uv pip install ./compute-sdk
    
    This installs the compute_sdk package, so import compute_sdk works 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_name is the app's entry class; find your collection_uuid on the platform under Settings → Profile.
  • Each entry in input_args is one run — pass many to solve in a batch.
  • Each result has status, logging (empty on success), and results_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:

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