Python SDK for the Uncertainty Engine
⚠️ Pre-Release Notice: This SDK is currently in pre-release development. Please ensure you are reading documentation that corresponds to the specific version of the SDK you have installed, as features and APIs may change between versions.
Requirements
- Python >=3.10, <3.13
- Valid Uncertainty Engine account
Installation
pip install uncertainty-engine
The SDK has optional extras that provide additional functionality:
| Name | Description |
|---|---|
data |
Installs data processing packages |
notebook |
Installs support for running the SDK in Jupyter notebooks |
vis |
Installs support for visualising graphs |
Install one or more of these via pip by providing them as a comma-separated list:
pip install "uncertainty-engine[data,notebook,vis]"
Usage
Setting your username and password
To run and queue workflows you must have your Uncertainty Engine username and password set up. To do this you can run the following in your terminal:
export UE_USERNAME="your_username"
export UE_PASSWORD="your_password"
Creating a client
All interactions with the Uncertainty Engine API are performed via a Client. The client can be defined as follows:
from uncertainty_engine import Client
client = Client()
With an instantiated Client object, and username and password set as environmental variables, authentication can be carried via the following:
client.authenticate()
Using different environments
The Client defaults to using the Uncertainty Engine production environment. To use a different named environment, pass it as the env argument:
client = Client(env="dev")
If a custom environment has been provided for you, pass an Environment that describes the details:
from uncertainty_engine import Client, Environment
client = Client(
env=Environment(
cognito_user_pool_client_id="…",
core_api="…",
region="…",
resource_api="…",
),
)
| Argument | Format | Example |
|---|---|---|
cognito_user_pool_client_id |
Alphanumeric string | 3vj5pe253j4v070euqjdk38a24 |
core_api |
Starts with https://, does not end with / |
https://de1v75vvk6.execute-api.eu-west-2.amazonaws.com |
region |
Geographic region code | eu-west-2 |
resource_api |
Starts with https://, does not end with / |
https://m90q55iux6.execute-api.eu-west-2.amazonaws.com |
Note: Every password is tied to a specific environment. A password for the production environment, for example, won't grant access to the development environment. Ensure you set the correct UE_PASSWORD value for the environment you configure.
Troubleshooting
Authorisation tokens are cached in .ue_auth in your home directory. If the SDK fails to authenticate you (for example, after switching from one environment to another), delete .ue_auth to generate and cache new tokens.
To delete the cache in macOS or Linux:
rm ~/.ue_auth
To delete the cache in Windows:
del "%USERPROFILE%\.ue_auth"
Running a node
from pprint import pprint
from uncertainty_engine import Client, Environment
from uncertainty_engine.nodes.basic import Add
# Set up the client
client = Client()
client.authenticate()
# Create a node
add = Add(lhs=1, rhs=2)
# Run the node on the server
response = client.run_node(add)
# Get the result
result = response.outputs
pprint(result)
For more some more in-depth examples checkout our example notebooks.
Metadata
Release files for uncertainty-engine 0.14.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uncertainty_engine-0.14.1.tar.gz | 38.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uncertainty_engine-0.14.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 92.9 kB
Release files / uncertainty_engine-0.14.1.tar.gz
| Download URL | uncertainty_engine-0.14.1.tar.gz |
|---|---|
| Size | 38.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d82120c9093702c320c2774c421b302031177518627ddb19c3fe76d6d0504ab8
|
|
BLAKE2b-256 checksum How to use checksums |
31c5d34f083c5e6fb533d1a156d0724404e455fa01fc55af67c1fbc65232812f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.5 Darwin/25.3.0
|
Release files / uncertainty_engine-0.14.1-py3-none-any.whl
| Download URL | uncertainty_engine-0.14.1-py3-none-any.whl |
|---|---|
| Size | 54.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f47724974596a81d107e32e361e62ac9052d69a918e012096f6f11fea8f8547
|
|
BLAKE2b-256 checksum How to use checksums |
1e60ec065614f3cb974515ca9d3842a7daa05de78ee5893b78a04fa0bac907d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.5 Darwin/25.3.0
|