MaximaLabsOpen app

Python SDK Reference

A zero-dependency client (`pip install flowsim-sdk`, standard library only) wrapping the same REST API the app itself uses — build flowsheets, run/poll solves, and fetch stream/cost/sustainability results.

sdkpython
Concept

A zero-dependency client (standard library urllib only — no numpy/scipy/ solver stack) wrapping the same REST API the app itself uses. Every method is a thin wrapper; nothing the SDK does is a special, less-capable path.

Execution

Simulator — the app's result sheets in Python

Simulator is the object every notebook pre-loads. Outside a notebook, bind one to a simulation yourself; each method reads the endpoint its sheet in the app reads, so a number in a notebook is the number on the screen.

pip install flowsim-sdk pandas

from flowsim.sdk import FlowSimClient
from flowsim.sdk.notebook import Simulator

Simulator = Simulator(FlowSimClient("https://maximalabs.io"), sim_id)
Simulator.run()                      # the same worker as the Run button

Simulator.stream_table()             # Streams        Simulator.block_table()     # Blocks
Simulator.workbook()                 # Workbook tabs  Simulator.utility_table()   # Utilities
Simulator.economics_table()          # Economics      Simulator.safety_table()    # Safety
Simulator.cycle_table()              # Cycle Efficiencies
Simulator.pinch_table()              # Pinch Targets  Simulator.hen_table()       # HEN design
Simulator.convergence()              # tears, sequence, residual history
Simulator.sensitivity("COL", "reflux_ratio", 1.5, 4.0, points=5, outputs=[
    {"kind": "metric", "node": "COL", "name": "reboiler_duty"},
    {"kind": "stream", "edge": "e2", "component": "ethanol"},
])                                   # the sweep, as a DataFrame
Simulator.analysis("relief-sizing", **request)   # any analysis tool by its route name
Execution

Underneath: the client

client = FlowSimClient("https://maximalabs.io")

# simulate & analyze
client.create_simulation(name, flowsheet); client.run(sim_id); client.wait(sim_id)
client.streams(sim_id); client.cost(sim_id); client.sustainability(sim_id)
client.hx_rating(sim_id); client.safety(sim_id); client.datasheet(sim_id)
client.optimize(sim_id, spec); client.sensitivity(sim_id, spec)

# collaborate & organize
client.save_snapshot(sim_id); client.restore_snapshot(sim_id, snap_id)
client.add_collaborator(sim_id, email); client.create_project(name)

# digital twin
client.twin(sim_id); client.twin_history(sim_id, tag); client.add_twin_readings(sim_id, readings)

flowsim.sdk.batch.run_batch is a separate, headless runner for ML/RTO pipelines — it calls the pure solver directly (in-process, needs numpy/scipy/ CoolProp) rather than going over HTTP, for when you're generating thousands of runs for a sensitivity study or synthetic training data.