Skip to main content

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 task
  • get_execution_status() - Get current execution status

Workflow Script Operations

  • list_workflow_scripts(search_key='', deck_name='') - List available scripts
  • load_workflow_script(workflow_name) - Load a specific script
  • submit_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 repeat
  • run_workflow_kwargs(kwargs_list=None) - Run workflow with parameter sets
  • run_workflow_campaign(parameters, objectives, repeat=25, parameter_constraints=None) - Run optimization campaign

Workflow Control

  • pause_and_resume() - Toggle workflow pause/resume
  • abort_pending_workflow() - Abort pending executions
  • stop_current_workflow() - Stop current execution

Data Operations

  • list_workflow_data(workflow_name='') - List workflow execution data
  • load_workflow_data(workflow_id) - Load specific workflow data

Exception Handling

The client provides specific exception types:

  • IvoryosError - Base exception
  • AuthenticationError - Authentication failures
  • ConnectionError - Connection issues
  • WorkflowError - Workflow operation failures
  • TaskError - 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run the test suite
  6. Submit a pull request

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

ivoryos_client-0.2.7.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

ivoryos_client-0.2.7-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file ivoryos_client-0.2.7.tar.gz.

File metadata

  • Download URL: ivoryos_client-0.2.7.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for ivoryos_client-0.2.7.tar.gz
Algorithm Hash digest
SHA256 cf3fd83b8cddbe5bb452289f6133ed5dc6854e1a68d369fb8d7764ac22c94a2e
MD5 16fe99b7803704ac0fc30d690e6e2dcf
BLAKE2b-256 f0e3e882112ac30e25f83b1d1a965f504e900fdb617ced66e5b74a9a2d0ec6c0

See more details on using hashes here.

File details

Details for the file ivoryos_client-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: ivoryos_client-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for ivoryos_client-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c9893cc2b7ad39a15c88b3e11c1e6c05ee09ee870ac1bd1ac4320ed031492841
MD5 95327a46a54fb60e7d6e406b3f4b156d
BLAKE2b-256 d51072350f8ab47e4820b280114ed6d963a053dc216ada0b1c3bb2ba0e826998

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