Python client for IvoryOS workflow orchestrator
Project description
ivoryOS client
Description
ivoryOS client automates the generation of client-side APIs based on server-defined robotic control script. It mirrors the control Python code features but sending command through HTTP request to the ivoryOS backend (where the actual robotic communication are happening) that receives the info and execute the actual control methods.
Installation
pip install ivoryos-client
Quick Start
from ivoryos_client import IvoryosClient
# Initialize client
client = IvoryosClient(
url="http://localhost:8000/ivoryos",
username="admin",
password="admin"
)
# Or use as context manager
with IvoryosClient(url="http://localhost:8000/ivoryos", username="admin", password="admin") as client:
# Get platform info
info = client.get_platform_info()
print(info)
# Check execution status
status = client.get_execution_status()
print(status)
# Execute a task
result = client.execute_task("sdl", "dose_solid", {"amount_in_mg": "5"})
print(result)
Features
- Task Execution: Execute robot tasks with parameters
- Workflow Management: Submit, load, and manage workflow scripts
- Workflow Execution: Run workflows with different strategies (repeat, kwargs, campaign)
- Data Management: List and load workflow execution data
- Status Monitoring: Check workflow execution status
- Error Handling: Comprehensive exception handling with specific error types
API Reference
Client Initialization
IvoryosClient(url, username, password, timeout=30.0)
Task Operations
execute_task(component, method, kwargs=None)- Execute a taskget_execution_status()- Get current execution status
Workflow Script Operations
list_workflow_scripts(search_key='', deck_name='')- List available scriptsload_workflow_script(workflow_name)- Load a specific scriptsubmit_workflow_script(workflow_name, main_script='', cleanup_script='', prep_script='')- Submit a script
Workflow Execution
run_workflow_repeat(repeat_time=None)- Run workflow with simple repeatrun_workflow_kwargs(kwargs_list=None)- Run workflow with parameter setsrun_workflow_campaign(parameters, objectives, repeat=25, parameter_constraints=None)- Run optimization campaign
Workflow Control
pause_and_resume()- Toggle workflow pause/resumeabort_pending_workflow()- Abort pending executionsstop_current_workflow()- Stop current execution
Data Operations
list_workflow_data(workflow_name='')- List workflow execution dataload_workflow_data(workflow_id)- Load specific workflow data
Exception Handling
The client provides specific exception types:
IvoryosError- Base exceptionAuthenticationError- Authentication failuresConnectionError- Connection issuesWorkflowError- Workflow operation failuresTaskError- Task execution failures
from ivoryos_client import IvoryosClient, AuthenticationError, WorkflowError
try:
with IvoryosClient(url="http://localhost:8000/ivoryos", username="admin", password="admin") as client:
result = client.execute_task("sdl", "dose_solid", {"amount_in_mg": "5"})
except AuthenticationError:
print("Authentication failed")
except WorkflowError as e:
print(f"Workflow error: {e}")
Development
Setup Development Environment
git clone https://gitlab.com/heingroup/ivoryos-suite/ivoryos-client
cd ivoryos-client
pip install -e ".[dev]"
License
MIT License
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run the test suite
- Submit a pull request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ivoryos_client-0.2.9.tar.gz.
File metadata
- Download URL: ivoryos_client-0.2.9.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c332bcfcc142438a511e486886416d22ef80b35c4f13927f7a7d34c2e85d74d
|
|
| MD5 |
e9f2b56e767dd4a6c6972f63fdd102d6
|
|
| BLAKE2b-256 |
61ee1dc35947c61afef778bf225f73f8af7c88a9e034a9dcf32b8f2ceac7957c
|
File details
Details for the file ivoryos_client-0.2.9-py3-none-any.whl.
File metadata
- Download URL: ivoryos_client-0.2.9-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
359f4069ab7a87c3dc6fa6138ef4fd8982a408998e4483df82d0ea80eae06a9e
|
|
| MD5 |
d62a9213f323e7e6cf53eadb728b4bdb
|
|
| BLAKE2b-256 |
393144222c064686f8c298b3c259d2786785990dc004d767481e82788c56812c
|