Metadata-Version: 2.3
Name: uncertainty-engine
Version: 0.7.0
Summary: SDK for the Uncertainty Engine
Author: digiLab Solutions Ltd.
Author-email: info@digilab.ai
Maintainer: Jamie Donald-McCann
Maintainer-email: jamie.donald-mccann@digilab.ai
Requires-Python: >=3.10,<3.13
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Provides-Extra: data
Provides-Extra: notebook
Provides-Extra: vis
Requires-Dist: boto3 (>=1.38.14,<2.0.0)
Requires-Dist: boto3-stubs[cognito-idp] (>=1.38.20,<2.0.0)
Requires-Dist: botocore (>=1.38.14,<2.0.0)
Requires-Dist: ipykernel (>=6.29.5,<7.0.0) ; extra == "notebook"
Requires-Dist: matplotlib (>=3.10.0,<4.0.0) ; extra == "vis"
Requires-Dist: networkx (>=3.4.2,<4.0.0) ; extra == "vis"
Requires-Dist: numpy (>=2.2.6,<3.0.0) ; extra == "data"
Requires-Dist: pandas (>=2.2.3,<3.0.0) ; extra == "data"
Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
Requires-Dist: requests (>=2.32.4,<3.0.0)
Requires-Dist: typeguard (>=4.4.2,<5.0.0)
Requires-Dist: uncertainty-engine-resource-client (>=0.1.0,<0.2.0)
Requires-Dist: uncertainty-engine-types (>=0.0.11,<0.0.12)
Description-Content-Type: text/markdown

![Uncertainty Engine banner](https://github.com/digiLab-ai/uncertainty-engine-types/raw/main/assets/images/uncertainty-engine-logo.png)

# Python SDK for the Uncertainty Engine

[![PyPI](https://badge.fury.io/py/uncertainty-engine.svg)](https://badge.fury.io/py/uncertainty-engine) [![Python Versions](https://img.shields.io/pypi/pyversions/uncertainty-engine.svg)](https://pypi.org/project/uncertainty-engine/)

## Requirements

- Python >=3.10, <3.13
- Valid Uncertainty Engine account

## Installation

```bash
pip install uncertainty-engine
```

With optional dependencies:

```bash
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:

```bash
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:

```python
from uncertainty_engine import Client

client = Client()
```

To create a `Client` for a named environment:

```python
from uncertainty_engine import Client

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

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

To create a `Client` for a custom environment:

```python
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

```python
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](https://github.com/digiLab-ai/uncertainty-engine-sdk/tree/dev/examples).

## Support

For any support needs please visit our [support page](https://support.uncertaintyengine.ai).

