Skip to main content

SDK for the Uncertainty Engine

Project description

Uncertainty Engine banner

Python SDK for the Uncertainty Engine

PyPI Python Versions

⚠️ 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

With optional dependencies:

pip install "uncertainty_engine[vis,notebook,data]"

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()

To create a Client for a named environment:

from uncertainty_engine import Client

client = Client(env="<NAME>")

# For example:
client = Client(env="dev")

To create a Client for a custom environment:

from uncertainty_engine import Client, Environment

client = Client(
   env=Environment(
        cognito_user_pool_client_id="<COGNITO USER POOL APPLICATION CLIENT ID>",
        core_api="<UNCERTAINTY ENGINE CORE API URL>",
        region="<REGION>",
        resource_api="<UNCERTAINTY ENGINE RESOURCE SERVICE API URL>",
   ),
)

# For example:
client = Client(
   env=Environment(
        cognito_user_pool_client_id="3n437fei4uhp4ouj8b4mmt09l9",
        core_api="https://s0r8fczyag.execute-api.eu-west-2.amazonaws.com",
        region="eu-west-2",
        resource_api="https://hmqdnx48x6.execute-api.eu-west-2.amazonaws.com",
   ),
)

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(
   env=Environment(
        cognito_user_pool_client_id="<COGNITO USER POOL APPLICATION CLIENT ID>",
        core_api="<UNCERTAINTY ENGINE CORE API URL>",
        region="<REGION>",
        resource_api="<UNCERTAINTY ENGINE RESOURCE SERVICE API URL>",
   ),
)

# 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.

Support

For any support needs please visit our support page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uncertainty_engine-0.8.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uncertainty_engine-0.8.0-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file uncertainty_engine-0.8.0.tar.gz.

File metadata

  • Download URL: uncertainty_engine-0.8.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.5 Darwin/23.6.0

File hashes

Hashes for uncertainty_engine-0.8.0.tar.gz
Algorithm Hash digest
SHA256 65047cc765e863e295ddb45abecdb48562faec5a5c8a6146c4e05d20a0ec825c
MD5 0985d80b35e4edc891ad22c213e86e99
BLAKE2b-256 5983a3adfe72784a6a0002e5fde9797337f83cad587a8f22cc84df27aeef1cdc

See more details on using hashes here.

File details

Details for the file uncertainty_engine-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: uncertainty_engine-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.5 Darwin/23.6.0

File hashes

Hashes for uncertainty_engine-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92471d4d19f2f20b7a016415c4b4708510cb3ff01052bea83179ff75f93a63bc
MD5 41fca0e43624909f1b862367dff532d0
BLAKE2b-256 6d27eec9e4eb6fec6cad02183effbe0a20b6f87ace192bddc27d2ebe7d45aff9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page