What does the Python library do?

The Optumi Python library allows you to launch and manage workloads in the cloud.

<aside> 📌 Monitoring functionality is still catching up in the Python library. In the meantime, we recommend you monitor workloads using the web app or JupyterLab extension.

</aside>

Creating an account and getting started

You can download the API library (named ‘optumi_api’) from PyPi and install/upgrade it with the command:

python -m pip install -U optumi_api

Once you have created an Optumi account you can run your program with a few lines of code:

import optumi_api as opt
opt.login()
opt.Script(path="path/to/your/script.py").launch()

To get you started, we will introduce a few concepts. Our Python API library provides the ability to run workloads, monitor their performance and retrieve any logs or output results that are stored safely and securely in the Optumi cloud platform. To identify the program you want to run, you create a Script, Notebook or Container object which you launch to obtain a Workload object that captures logs, telemetry and output results. Workloads execute on cloud machines (represented by Machine objects) that are automatically released when no longer needed.

You can also configure the execution environment in which your workload runs by specifying Python packages, input files and environment variables. Required packages are defined with a Packages object. Input files will be prepositioned on the cloud machine before your workload starts running either by uploading from your computer (see LocalStorage) or fetching from public or private sources on the internet (see DataConnectors). Output logs, telemetry and results are captured (see CloudStorage) and can be listed, downloaded and removed as desired. You can also configure event notifications (SMS, emails) to stay informed of workload progress.

For ease of programming, our Python methods are synchronous by default but many have optional parameters to make them asynchronous where this can yield benefits. For instance uploading multiple input files can proceed in parallel while you wait for a workload to complete execution.

Key commands

To see full documentation click here or run:

import optumi_api as opt
opt.docs()

Here are some useful commands when using the Python library: