from tmp_test import new_experiment
# OuterRail
An SDK for AIoD - RAIL tool.
## What is RAIL
RAIL stands for: __Research and Innovation AI Lab__
RAIL is a tool that allows AI practitioners to explore and use AI assets
directly in the AI on Demand platform (AIoD). RAIL is developed within the
[AI4Europe project](https://www.ai4europe.eu) as one of the core services
of the [AI on Demand platform](https://aiod.eu).
## Requirements
Python 3.9+
## Installation
### pip install
The OuterRail package can simply be installed with pip via command:
```sh
pip install OuterRail
```
### Manual installation with wheel
## Usage
### Importing the package
You can import the SDK with:
```python
import OuterRail
```
### Configuration
For the SDK to work with underlying RAIL backend, you need to
specify the URL of the RAIL as well as your API key.
The code for this would look something like:
```python
import os
from OuterRail import Configuration
os.environ["AIOD_RAIL_API_KEY"] = "your_api_key"
config = Configuration(host="http://localhost:8000")
```
### Examples:
#### Experiment Template Manager
```python
### EXPERIMENT TEMPLATE MANAGER TESTING
from OuterRail import ExperimentTemplateManager
template_manager = ExperimentTemplateManager(config)
# Get the count of available templates
template_manager.count()
# Get the list of Template instances
template_manager.get()
# Get a single template by its identifier
template_manager.get_by_id("identifier_here")
# Create new template
script_path = "script.py" # Adjust this
requirements_path = "requirements.txt" # Adjust this
base_image = "python:3.9"
template_config = {
"name": "Example Template",
"description": "Description of example template",
"task": "TEXT_CLASSIFICATION",
"datasets_schema": { "cardinality": "1-1" },
"models_schema": { "cardinality": "1-1" },
"envs_required": [ { "name": "SPLIT_NAME", "description": "name of a subset" }
],
"envs_optional": [], "available_metrics": [ "accuracy" ],
"is_public": True
}
new_template = template_manager.create((script_path, requirements_path, base_image, template_config))
```
#### Experiment Template class
```python
from OuterRail import ExperimentTemplateManager
# Get some experiment
template_manager = ExperimentTemplateManager(config)
template = template_manager.get()[0]
# Check if template is archived
print(template.is_archived)
# Archive template
template.archive(True)
# Update template (uses same params as create)
template.update((script_path, requirements_path, base_image, template_config)).name
# Delete template
template.delete()
```
### Experiment Manager
```python
from OuterRail import ExperimentManager
# Initialize
exp_manager = ExperimentManager(config)
# Get the count of experiments
exp_manager.count()
# Fetch only experiments that belong to you
experiments = exp_manager.get(mine=True)
# Create an example experiment
experiment_dict = {
"name": "test123",
"description": "321test",
"is_public": True,
"experiment_template_id": "685151f2d08da970a3a5d6ce",
"dataset_ids": [ "data_000002AhzqHqOQwQLP0qCRds" ],
"model_ids": [ "mdl_003Csk8QjNfE80c7g6Rt8yVb" ],
"publication_ids": [],
"env_vars": [ { "key": "SPLIT_NAME", "value": "Test"
}
]
}
new_experiment = exp_manager.create(experiment_dict)
```
#### Experiment class
```python
from OuterRail import ExperimentManager
# Initialize
exp_manager = ExperimentManager(config)
# Get a single experiment that belongs to you
new_experiment = exp_manager.get(mine=True)[0]
# Check archivation
new_experiment.is_archived
# Archive experiment
new_experiment.archive(archive=False)
# Update experiment
update_dict = {
"name": "NewAndImprovedName",
"description": "321test",
"is_public": True,
"experiment_template_id": "685151f2d08da970a3a5d6ce",
"dataset_ids": [ "data_000002AhzqHqOQwQLP0qCRds" ],
"model_ids": [ "mdl_003Csk8QjNfE80c7g6Rt8yVb" ],
"publication_ids": [],
"env_vars": [ { "key": "SPLIT_NAME", "value": "Test"
}
]
}
new_experiment.update(update_dict)
# Delete
new_experiment.delete()
# Count the runs of some an experiment
new_experiment.count_runs()
# Get list of runs
new_experiment.get_runs()
```
#### Experiment run class
```python
# Create an instance by running the experiment
exp_run = new_experiment.run()
# Check the state
print(exp_run.state)
# Check the logs of the run
print(f"exp run logs: {exp_run.logs()}")
# Delete a run
exp_run.delete()
```
## Author
This SDK was created at [KInIT](https://kinit.sk) by Jozef Barut.
Raw data
{
"_id": null,
"home_page": null,
"name": "OuterRail",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "SDK, AIoD, RAIL, Machine Learning, ML Experiments",
"author": "OpenAPI Generator community",
"author_email": "Jozef Barut <jozef.barut@intern.kinit.sk>",
"download_url": "https://files.pythonhosted.org/packages/28/b8/ba4e4b945bdb6bf922f78caa323641a6dfb0d7cc0f83c4a0561f3737b9da/outerrail-1.0.1.tar.gz",
"platform": null,
"description": "from tmp_test import new_experiment\n\n# OuterRail\n\nAn SDK for AIoD - RAIL tool.\n\n## What is RAIL\n\nRAIL stands for: __Research and Innovation AI Lab__\n\nRAIL is a tool that allows AI practitioners to explore and use AI assets \ndirectly in the AI on Demand platform (AIoD). RAIL is developed within the \n[AI4Europe project](https://www.ai4europe.eu) as one of the core services \nof the [AI on Demand platform](https://aiod.eu).\n\n## Requirements\n\nPython 3.9+\n\n## Installation \n### pip install\nThe OuterRail package can simply be installed with pip via command:\n```sh\npip install OuterRail\n```\n### Manual installation with wheel\n\n## Usage\n\n### Importing the package\n\nYou can import the SDK with:\n```python\nimport OuterRail\n```\n### Configuration\nFor the SDK to work with underlying RAIL backend, you need to \nspecify the URL of the RAIL as well as your API key.\nThe code for this would look something like:\n\n```python\nimport os\nfrom OuterRail import Configuration\n\nos.environ[\"AIOD_RAIL_API_KEY\"] = \"your_api_key\"\nconfig = Configuration(host=\"http://localhost:8000\")\n```\n\n### Examples:\n\n#### Experiment Template Manager\n```python\n### EXPERIMENT TEMPLATE MANAGER TESTING\nfrom OuterRail import ExperimentTemplateManager\n\ntemplate_manager = ExperimentTemplateManager(config)\n\n# Get the count of available templates\ntemplate_manager.count()\n# Get the list of Template instances\ntemplate_manager.get()\n# Get a single template by its identifier\ntemplate_manager.get_by_id(\"identifier_here\")\n\n# Create new template\nscript_path = \"script.py\" # Adjust this\nrequirements_path = \"requirements.txt\" # Adjust this\nbase_image = \"python:3.9\"\ntemplate_config = {\n \"name\": \"Example Template\",\n \"description\": \"Description of example template\",\n \"task\": \"TEXT_CLASSIFICATION\",\n \"datasets_schema\": { \"cardinality\": \"1-1\" },\n \"models_schema\": { \"cardinality\": \"1-1\" },\n \"envs_required\": [ { \"name\": \"SPLIT_NAME\", \"description\": \"name of a subset\" }\n ],\n \"envs_optional\": [], \"available_metrics\": [ \"accuracy\" ],\n \"is_public\": True\n}\nnew_template = template_manager.create((script_path, requirements_path, base_image, template_config))\n```\n\n#### Experiment Template class\n\n```python\nfrom OuterRail import ExperimentTemplateManager\n\n# Get some experiment\ntemplate_manager = ExperimentTemplateManager(config)\ntemplate = template_manager.get()[0]\n\n# Check if template is archived\nprint(template.is_archived)\n\n# Archive template\ntemplate.archive(True)\n\n# Update template (uses same params as create)\ntemplate.update((script_path, requirements_path, base_image, template_config)).name\n\n# Delete template\ntemplate.delete()\n```\n\n### Experiment Manager\n```python\nfrom OuterRail import ExperimentManager\n\n# Initialize\nexp_manager = ExperimentManager(config)\n\n# Get the count of experiments\nexp_manager.count()\n# Fetch only experiments that belong to you\nexperiments = exp_manager.get(mine=True)\n\n# Create an example experiment\nexperiment_dict = {\n \"name\": \"test123\",\n \"description\": \"321test\",\n \"is_public\": True,\n \"experiment_template_id\": \"685151f2d08da970a3a5d6ce\",\n \"dataset_ids\": [ \"data_000002AhzqHqOQwQLP0qCRds\" ],\n \"model_ids\": [ \"mdl_003Csk8QjNfE80c7g6Rt8yVb\" ],\n \"publication_ids\": [],\n \"env_vars\": [ { \"key\": \"SPLIT_NAME\", \"value\": \"Test\"\n }\n ]\n}\nnew_experiment = exp_manager.create(experiment_dict)\n```\n\n#### Experiment class\n\n```python\n\nfrom OuterRail import ExperimentManager\n\n# Initialize\nexp_manager = ExperimentManager(config)\n# Get a single experiment that belongs to you\nnew_experiment = exp_manager.get(mine=True)[0]\n\n# Check archivation\nnew_experiment.is_archived\n\n# Archive experiment\nnew_experiment.archive(archive=False)\n\n# Update experiment\nupdate_dict = {\n \"name\": \"NewAndImprovedName\",\n \"description\": \"321test\",\n \"is_public\": True,\n \"experiment_template_id\": \"685151f2d08da970a3a5d6ce\",\n \"dataset_ids\": [ \"data_000002AhzqHqOQwQLP0qCRds\" ],\n \"model_ids\": [ \"mdl_003Csk8QjNfE80c7g6Rt8yVb\" ],\n \"publication_ids\": [],\n \"env_vars\": [ { \"key\": \"SPLIT_NAME\", \"value\": \"Test\"\n }\n ]\n}\nnew_experiment.update(update_dict)\n\n# Delete\nnew_experiment.delete()\n\n# Count the runs of some an experiment\nnew_experiment.count_runs()\n\n# Get list of runs\nnew_experiment.get_runs()\n```\n\n#### Experiment run class\n\n```python\n# Create an instance by running the experiment\nexp_run = new_experiment.run()\n\n# Check the state\nprint(exp_run.state)\n\n# Check the logs of the run\nprint(f\"exp run logs: {exp_run.logs()}\")\n\n# Delete a run\nexp_run.delete()\n```\n\n## Author\n\nThis SDK was created at [KInIT](https://kinit.sk) by Jozef Barut.\n",
"bugtrack_url": null,
"license": null,
"summary": "AIoD - RAIL. SDK for the RAIL service of the AI on Demand platform.",
"version": "1.0.1",
"project_urls": {
"repository": "https://github.com/aiondemand/aiod-rail/tree/feature/outer-sdk/sdk-py"
},
"split_keywords": [
"sdk",
" aiod",
" rail",
" machine learning",
" ml experiments"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "55065f585524eacd71072d86575df98286ffb5929f7d8461b48f18d45a89a3e3",
"md5": "090c86c6bc2f1fa4918c16d637024a14",
"sha256": "91a1bb2fa58a2c94f1d389658dbd5ee0df1521d067c76c340c489fad9f4fcedb"
},
"downloads": -1,
"filename": "outerrail-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "090c86c6bc2f1fa4918c16d637024a14",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 133977,
"upload_time": "2025-07-09T01:24:08",
"upload_time_iso_8601": "2025-07-09T01:24:08.993571Z",
"url": "https://files.pythonhosted.org/packages/55/06/5f585524eacd71072d86575df98286ffb5929f7d8461b48f18d45a89a3e3/outerrail-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "28b8ba4e4b945bdb6bf922f78caa323641a6dfb0d7cc0f83c4a0561f3737b9da",
"md5": "698f21cad9f6530560d70df23322444b",
"sha256": "559faf20fc6a42bc7dbe991fd99022cb45bf3d87387de84864756ed90b39528e"
},
"downloads": -1,
"filename": "outerrail-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "698f21cad9f6530560d70df23322444b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 83127,
"upload_time": "2025-07-09T01:24:10",
"upload_time_iso_8601": "2025-07-09T01:24:10.525597Z",
"url": "https://files.pythonhosted.org/packages/28/b8/ba4e4b945bdb6bf922f78caa323641a6dfb0d7cc0f83c4a0561f3737b9da/outerrail-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-09 01:24:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aiondemand",
"github_project": "aiod-rail",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "outerrail"
}