# ivoryOS client
## Description
[ivoryOS](https://gitlab.com/heingroup/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
```bash
pip install ivoryos-client
```
## Quick Start
```python
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
```python
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
```python
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
```bash
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
Raw data
{
"_id": null,
"home_page": null,
"name": "ivoryos-client",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Ivory Zhang <ivoryzhang@chem.ubc.ca>",
"keywords": "ivoryos, workflow, orchestrator, automation, laboratory",
"author": null,
"author_email": "Ivory Zhang <ivoryzhang@chem.ubc.ca>",
"download_url": "https://files.pythonhosted.org/packages/0c/a0/11e5ff6febb072df7d306031d8032b51a86427e01c012b208178c044d711/ivoryos_client-0.2.1.tar.gz",
"platform": null,
"description": "# ivoryOS client\n\n## Description\n[ivoryOS](https://gitlab.com/heingroup/ivoryos) client automates the generation of client-side APIs based on server-defined robotic control script. \nIt 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.\n\n## Installation\n```bash\npip install ivoryos-client\n```\n\n## Quick Start\n\n```python\nfrom ivoryos_client import IvoryosClient\n\n# Initialize client\nclient = IvoryosClient(\n url=\"http://localhost:8000/ivoryos\",\n username=\"admin\",\n password=\"admin\"\n)\n\n# Or use as context manager\nwith IvoryosClient(url=\"http://localhost:8000/ivoryos\", username=\"admin\", password=\"admin\") as client:\n # Get platform info\n info = client.get_platform_info()\n print(info)\n \n # Check execution status\n status = client.get_execution_status()\n print(status)\n \n # Execute a task\n result = client.execute_task(\"sdl\", \"dose_solid\", {\"amount_in_mg\": \"5\"})\n print(result)\n```\n\n## Features\n\n- **Task Execution**: Execute robot tasks with parameters\n- **Workflow Management**: Submit, load, and manage workflow scripts\n- **Workflow Execution**: Run workflows with different strategies (repeat, kwargs, campaign)\n- **Data Management**: List and load workflow execution data\n- **Status Monitoring**: Check workflow execution status\n- **Error Handling**: Comprehensive exception handling with specific error types\n\n## API Reference\n\n### Client Initialization\n\n```python\nIvoryosClient(url, username, password, timeout=30.0)\n```\n\n### Task Operations\n\n- `execute_task(component, method, kwargs=None)` - Execute a task\n- `get_execution_status()` - Get current execution status\n\n### Workflow Script Operations\n\n- `list_workflow_scripts(search_key='', deck_name='')` - List available scripts\n- `load_workflow_script(workflow_name)` - Load a specific script\n- `submit_workflow_script(workflow_name, main_script='', cleanup_script='', prep_script='')` - Submit a script\n\n### Workflow Execution\n\n- `run_workflow_repeat(repeat_time=None)` - Run workflow with simple repeat\n- `run_workflow_kwargs(kwargs_list=None)` - Run workflow with parameter sets\n- `run_workflow_campaign(parameters, objectives, repeat=25, parameter_constraints=None)` - Run optimization campaign\n\n### Workflow Control\n\n- `pause_and_resume()` - Toggle workflow pause/resume\n- `abort_pending_workflow()` - Abort pending executions\n- `stop_current_workflow()` - Stop current execution\n\n### Data Operations\n\n- `list_workflow_data(workflow_name='')` - List workflow execution data\n- `load_workflow_data(workflow_id)` - Load specific workflow data\n\n## Exception Handling\n\nThe client provides specific exception types:\n\n- `IvoryosError` - Base exception\n- `AuthenticationError` - Authentication failures\n- `ConnectionError` - Connection issues\n- `WorkflowError` - Workflow operation failures\n- `TaskError` - Task execution failures\n\n```python\nfrom ivoryos_client import IvoryosClient, AuthenticationError, WorkflowError\n\ntry:\n with IvoryosClient(url=\"http://localhost:8000/ivoryos\", username=\"admin\", password=\"admin\") as client:\n result = client.execute_task(\"sdl\", \"dose_solid\", {\"amount_in_mg\": \"5\"})\nexcept AuthenticationError:\n print(\"Authentication failed\")\nexcept WorkflowError as e:\n print(f\"Workflow error: {e}\")\n```\n\n## Development\n\n### Setup Development Environment\n\n```bash\ngit clone https://gitlab.com/heingroup/ivoryos-suite/ivoryos-client\ncd ivoryos-client\npip install -e \".[dev]\"\n```\n\n## License\n\nMIT License\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests\n5. Run the test suite\n6. Submit a pull request\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python client for IvoryOS workflow orchestrator",
"version": "0.2.1",
"project_urls": {
"Bug Tracker": "https://gitlab.com/heingroup/ivoryos-suite/ivoryos-client/-/issues",
"Documentation": "https://gitlab.com/heingroup/ivoryos-suite/ivoryos-client#readme",
"Homepage": "https://gitlab.com/heingroup/ivoryos-suite/ivoryos-client",
"Source Code": "https://gitlab.com/heingroup/ivoryos-suite/ivoryos-client"
},
"split_keywords": [
"ivoryos",
" workflow",
" orchestrator",
" automation",
" laboratory"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e59d64a216594ae5e4102e9a717beefcc4158940b2c19e641a16369f48fd1af1",
"md5": "4dc0746bc5dc3a494e94231c04c62cd7",
"sha256": "e103d442d4ce389c47ee1bef163bdcd4b9341f96fa05de8a55f25fae8cf5d51c"
},
"downloads": -1,
"filename": "ivoryos_client-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4dc0746bc5dc3a494e94231c04c62cd7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 7098,
"upload_time": "2025-07-15T00:37:17",
"upload_time_iso_8601": "2025-07-15T00:37:17.217946Z",
"url": "https://files.pythonhosted.org/packages/e5/9d/64a216594ae5e4102e9a717beefcc4158940b2c19e641a16369f48fd1af1/ivoryos_client-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0ca011e5ff6febb072df7d306031d8032b51a86427e01c012b208178c044d711",
"md5": "3c79e6a93fc419769c100027143e2f7a",
"sha256": "3025b1cf72676f99874e5dd94cd08ca83c022e0636a14a9efb08854aca344349"
},
"downloads": -1,
"filename": "ivoryos_client-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "3c79e6a93fc419769c100027143e2f7a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7782,
"upload_time": "2025-07-15T00:37:18",
"upload_time_iso_8601": "2025-07-15T00:37:18.324355Z",
"url": "https://files.pythonhosted.org/packages/0c/a0/11e5ff6febb072df7d306031d8032b51a86427e01c012b208178c044d711/ivoryos_client-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-15 00:37:18",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "heingroup",
"gitlab_project": "ivoryos-suite",
"lcname": "ivoryos-client"
}