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.
pip install ivoryos-clientfrom 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)- 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
IvoryosClient(url, username, password, timeout=30.0)execute_task(component, method, kwargs=None)- Execute a taskget_execution_status()- Get current execution status
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
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
pause_and_resume()- Toggle workflow pause/resumeabort_pending_workflow()- Abort pending executionsstop_current_workflow()- Stop current execution
list_workflow_data(workflow_name='')- List workflow execution dataload_workflow_data(workflow_id)- Load specific workflow data
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}")git clone https://gitlab.com/heingroup/ivoryos-suite/ivoryos-client
cd ivoryos-client
pip install -e ".[dev]"MIT License
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run the test suite
- Submit a pull request