apheris-cli


Nameapheris-cli JSON
Version 0.38.0 PyPI version JSON
download
home_pageNone
SummaryApheris CLI package for interaction with the Apheris product.
upload_time2025-07-28 10:23:27
maintainerNone
docs_urlNone
authorApheris
requires_pythonNone
licenseNone
keywords python apheris federated learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Apheris CLI

The [Apheris](http://www.apheris.com) Command Line Interface (CLI) is a tool for Machine Learning Engineers and Data Scientists to define Federated computations, launch them and get the results through the Apheris product.

The CLI provides both terminal and Python interfaces to interact with the Apheris 3.0 platform. It can be used to create, activate and deactivate Compute Specs, and to submit and monitor compute jobs.

We recommend installing the CLI in a fresh virtual environment.

For a full guide to the CLI, please see the [Apheris CLI documentation](https://www.apheris.com/docs/data-science-and-ml/apheris-cli-hello-world.html).

## Quickstart: Python API

```python
import apheris

# Login to apheris
>>> apheris.login()
Logging in to your company account...
Apheris:
Authenticating with Apheris Cloud Platform...
Please continue the authorization process in your browser.

Login was successful

# List the datasets to which you have access
>>> apheris.list_datasets()
+-----+---------------------------------------------------------+--------------+---------------------------+
| idx |                        dataset_id                       | organization |       data custodian      |
+-----+---------------------------------------------------------+--------------+---------------------------+
|  0  |          cancer-medical-images_gateway-2_org-2          |    Org 2     |        Orsino Hoek        |
|  1  |          pneumonia-x-ray-images_gateway-2_org-2         |    Org 2     |        Orsino Hoek        |
|  2  |            covid-19-patients_gateway-1_org-1            |    Org 1     |      Agathe McFarland     |
|  3  | medical-decathlon-task004-hippocampus-a_gateway-1_org-1 |    Org 1     |      Agathe McFarland     |
|  4  | medical-decathlon-task004-hippocampus-b_gateway-2_org-2 |    Org 2     |        Orsino Hoek        |
| ... |                           ...                           |     ...      |            ...            |
+-----+---------------------------------------------------------+--------------+---------------------------+

# List models available to you
>>> apheris.list_models()
+-----+---------------------------+-------------------------------------+
|  id |            name           |               version               |
+-----+---------------------------+-------------------------------------+
|  0  |       apheris-nnunet      |                u.v.w                |
|  1  |     apheris-statistics    |                x.y.z                |
| ... |            ...            |                 ...                 |
+-----+---------------------------+-------------------------------------+

# List compuutations
>>> apheris.list_compute_specs()
+--------------------------------------+---------------------+------------------------------+
| ID                                   | Created             | Activation Status            |
+--------------------------------------+---------------------+------------------------------+
| f20eba74-28d2-4458-aedb-72a983cb2a33 | 2025-05-20 13:37:59 | inactive.awaiting_activation |
| 29d542ed-d273-4176-8e3f-dfc70311cf32 | 2025-05-20 13:38:44 | inactive.shutdown            |
| c4e3f12a-0b20-4475-9611-79846dcb23b6 | 2025-05-21 07:40:53 | inactive.shutdown            |
| aae7bf0e-0568-4441-8d85-fdabc6343a4d | 2025-05-21 07:48:57 | inactive.shutdown            |
| 67b76354-aae3-48cc-810a-fd79c1040cc3 | 2025-05-21 07:50:05 | inactive.shutdown            |
| 70829d63-bb77-4ff0-a1a9-90273aa38792 | 2025-05-23 06:16:36 | inactive.shutdown            |
| 41994296-be34-487c-893c-d183f7baeb99 | 2025-05-23 06:52:50 | inactive.shutdown            |
| f1589f63-cfc9-4b1a-b985-ee959121c765 | 2025-05-23 07:17:11 | inactive.shutdown            |
| 3640fed9-f1d3-43f8-9b6b-5cde345a5ed5 | 2025-05-26 11:56:14 | inactive.awaiting_activation |
| defe5013-2c73-4eb9-be52-1ae7aed841ff | 2025-05-26 12:00:59 | active.running               |
+--------------------------------------+---------------------+------------------------------+

# Run a job in Apheris
>>> from aphcli.api import job
>>> job.run(
...    datasets=[
...     "medical-decathlon-task004-hippocampus-a_gateway-1_org-1",
...     "medical-decathlon-task004-hippocampus-b_gateway-2_org-2"
...    ],
...    payload={"mode": "training", "model_configuration": "2d", "dataset_id": 4, "num_rounds": 1},
...    model="apheris-nnunet",
...    version="x.y.z"
...)
Job(duration='0:00:00', id=UUID('f77d5dc7-a2e7-4a2a-827d-49a2131b1ffe'), status='submitted', created_at=datetime.datetime(2025, 7, 8, 17, 17, 6, 897476), compute_spec_id=UUID('defe5013-2c73-4eb9-be52-1ae7aed841ff'))

# Logout of Apheris
>>> apheris.logout()
Logging out from Apheris Cloud Platform session
Successfully logged out
```

##  Quickstart: CLI

Logging into Apheris:

```console
$ apheris login
Logging in to your company account...
Apheris:
Authenticating with Apheris Cloud Platform...
Please continue the authorization process in your browser.

Login was successful
You are logged in:
 e-mail:  your.name@your-company.com
 organization: your_organisation
 environment: your_environment
```

You can check your current login status.

```console
$ apheris login status
You are logged in:
 e-mail:  your.name@your-company.com
 organization: your_organisation
 environment: your_environment
```

When you are done with your work, it is recommended to log out.

```console
$ apheris logout
Logging out from Apheris Cloud Platform session
Logging out from Apheris Compute environments session
Successfully logged out
```

You can see the datasets to which you've been given access using the `datasets` command:

```console
$ apheris datasets list
+-----+---------------------------------------------------------+--------------+---------------------------+
| idx |                        dataset_id                       | organization |       data custodian      |
+-----+---------------------------------------------------------+--------------+---------------------------+
|  0  |          cancer-medical-images_gateway-2_org-2          |    Org 2     |        Orsino Hoek        |
|  1  |          pneumonia-x-ray-images_gateway-2_org-2         |    Org 2     |        Orsino Hoek        |
|  2  |            covid-19-patients_gateway-1_org-1            |    Org 1     |      Agathe McFarland     |
|  3  | medical-decathlon-task004-hippocampus-a_gateway-1_org-1 |    Org 1     |      Agathe McFarland     |
|  4  | medical-decathlon-task004-hippocampus-b_gateway-2_org-2 |    Org 2     |        Orsino Hoek        |
| ... |                           ...                           |     ...      |            ...            |
+-----+---------------------------------------------------------+--------------+---------------------------+
```

And you can see models using the `models` command:

```console
$ apheris models list
+-----+---------------------------+-------------------------------------+
|  id |            name           |               version               |
+-----+---------------------------+-------------------------------------+
|  0  |       apheris-nnunet      |                u.v.w                |
|  1  |     apheris-statistics    |                x.y.z                |
| ... |            ...            |                 ...                 |
+-----+---------------------------+-------------------------------------+
```

You can schedule a job on Apheris using the `job` command:

```console
$ apheris job schedule \
--dataset_ids medical-decathlon-task004-hippocampus-a_gateway-1_org-1,medical-decathlon-task004-hippocampus-b_gateway-2_org-2 \
--model_id apheris-nnunet \
--model_version x.y.z \
--payload '{"mode": "training", "model_configuration": "2d", "dataset_id": 4, "num_rounds": 1}'
About to schedule job with parameters:
Dataset IDs: medical-decathlon-task004-hippocampus-a_gateway-1_org-1,medical-decathlon-task004-hippocampus-b_gateway-2_org-2
Model: apheris-nnunet:x.y.z
Payload: {"mode": "training", "model_configuration": "2d", "dataset_id": 4, "num_rounds": 1}
Resources:
  Client: 1.0 CPU, 0 GPU, 2000 MB memory
  Server: 1.0 CPU, 0 GPU, 2000 MB memory

Do you want to proceed? (y/N)
:y

The job was submitted! The job ID is d6f7b657-8b30-4636-8f4c-2d96678095ba
```

Check the status of a job:

```console
$ apheris job status

Using the cached `compute_spec_id` defe5013-2c73-4eb9-be52-1ae7aed841ff [2025-07-08 17:17:06].
Using the cached `job_id` f77d5dc7-a2e7-4a2a-827d-49a2131b1ffe [stored 2025-07-08 17:36:26].

status: running
```

Once a job is complete, you can download the results:

```console
$ apheris job download-results /path/to/store/results

Using the cached `compute_spec_id` defe5013-2c73-4eb9-be52-1ae7aed841ff [2025-07-08 17:17:06].
Using the cached `job_id` f77d5dc7-a2e7-4a2a-827d-49a2131b1ffe [stored 2025-07-08 17:36:26].

Successfully downloaded job outputs to /path/to/store/results
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "apheris-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, apheris, federated learning",
    "author": "Apheris",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# Apheris CLI\n\nThe [Apheris](http://www.apheris.com) Command Line Interface (CLI) is a tool for Machine Learning Engineers and Data Scientists to define Federated computations, launch them and get the results through the Apheris product.\n\nThe CLI provides both terminal and Python interfaces to interact with the Apheris 3.0 platform. It can be used to create, activate and deactivate Compute Specs, and to submit and monitor compute jobs.\n\nWe recommend installing the CLI in a fresh virtual environment.\n\nFor a full guide to the CLI, please see the [Apheris CLI documentation](https://www.apheris.com/docs/data-science-and-ml/apheris-cli-hello-world.html).\n\n## Quickstart: Python API\n\n```python\nimport apheris\n\n# Login to apheris\n>>> apheris.login()\nLogging in to your company account...\nApheris:\nAuthenticating with Apheris Cloud Platform...\nPlease continue the authorization process in your browser.\n\nLogin was successful\n\n# List the datasets to which you have access\n>>> apheris.list_datasets()\n+-----+---------------------------------------------------------+--------------+---------------------------+\n| idx |                        dataset_id                       | organization |       data custodian      |\n+-----+---------------------------------------------------------+--------------+---------------------------+\n|  0  |          cancer-medical-images_gateway-2_org-2          |    Org 2     |        Orsino Hoek        |\n|  1  |          pneumonia-x-ray-images_gateway-2_org-2         |    Org 2     |        Orsino Hoek        |\n|  2  |            covid-19-patients_gateway-1_org-1            |    Org 1     |      Agathe McFarland     |\n|  3  | medical-decathlon-task004-hippocampus-a_gateway-1_org-1 |    Org 1     |      Agathe McFarland     |\n|  4  | medical-decathlon-task004-hippocampus-b_gateway-2_org-2 |    Org 2     |        Orsino Hoek        |\n| ... |                           ...                           |     ...      |            ...            |\n+-----+---------------------------------------------------------+--------------+---------------------------+\n\n# List models available to you\n>>> apheris.list_models()\n+-----+---------------------------+-------------------------------------+\n|  id |            name           |               version               |\n+-----+---------------------------+-------------------------------------+\n|  0  |       apheris-nnunet      |                u.v.w                |\n|  1  |     apheris-statistics    |                x.y.z                |\n| ... |            ...            |                 ...                 |\n+-----+---------------------------+-------------------------------------+\n\n# List compuutations\n>>> apheris.list_compute_specs()\n+--------------------------------------+---------------------+------------------------------+\n| ID                                   | Created             | Activation Status            |\n+--------------------------------------+---------------------+------------------------------+\n| f20eba74-28d2-4458-aedb-72a983cb2a33 | 2025-05-20 13:37:59 | inactive.awaiting_activation |\n| 29d542ed-d273-4176-8e3f-dfc70311cf32 | 2025-05-20 13:38:44 | inactive.shutdown            |\n| c4e3f12a-0b20-4475-9611-79846dcb23b6 | 2025-05-21 07:40:53 | inactive.shutdown            |\n| aae7bf0e-0568-4441-8d85-fdabc6343a4d | 2025-05-21 07:48:57 | inactive.shutdown            |\n| 67b76354-aae3-48cc-810a-fd79c1040cc3 | 2025-05-21 07:50:05 | inactive.shutdown            |\n| 70829d63-bb77-4ff0-a1a9-90273aa38792 | 2025-05-23 06:16:36 | inactive.shutdown            |\n| 41994296-be34-487c-893c-d183f7baeb99 | 2025-05-23 06:52:50 | inactive.shutdown            |\n| f1589f63-cfc9-4b1a-b985-ee959121c765 | 2025-05-23 07:17:11 | inactive.shutdown            |\n| 3640fed9-f1d3-43f8-9b6b-5cde345a5ed5 | 2025-05-26 11:56:14 | inactive.awaiting_activation |\n| defe5013-2c73-4eb9-be52-1ae7aed841ff | 2025-05-26 12:00:59 | active.running               |\n+--------------------------------------+---------------------+------------------------------+\n\n# Run a job in Apheris\n>>> from aphcli.api import job\n>>> job.run(\n...    datasets=[\n...     \"medical-decathlon-task004-hippocampus-a_gateway-1_org-1\",\n...     \"medical-decathlon-task004-hippocampus-b_gateway-2_org-2\"\n...    ],\n...    payload={\"mode\": \"training\", \"model_configuration\": \"2d\", \"dataset_id\": 4, \"num_rounds\": 1},\n...    model=\"apheris-nnunet\",\n...    version=\"x.y.z\"\n...)\nJob(duration='0:00:00', id=UUID('f77d5dc7-a2e7-4a2a-827d-49a2131b1ffe'), status='submitted', created_at=datetime.datetime(2025, 7, 8, 17, 17, 6, 897476), compute_spec_id=UUID('defe5013-2c73-4eb9-be52-1ae7aed841ff'))\n\n# Logout of Apheris\n>>> apheris.logout()\nLogging out from Apheris Cloud Platform session\nSuccessfully logged out\n```\n\n## \u00a0Quickstart: CLI\n\nLogging into Apheris:\n\n```console\n$ apheris login\nLogging in to your company account...\nApheris:\nAuthenticating with Apheris Cloud Platform...\nPlease continue the authorization process in your browser.\n\nLogin was successful\nYou are logged in:\n e-mail:  your.name@your-company.com\n organization: your_organisation\n environment: your_environment\n```\n\nYou can check your current login status.\n\n```console\n$ apheris login status\nYou are logged in:\n e-mail:  your.name@your-company.com\n organization: your_organisation\n environment: your_environment\n```\n\nWhen you are done with your work, it is recommended to log out.\n\n```console\n$ apheris logout\nLogging out from Apheris Cloud Platform session\nLogging out from Apheris Compute environments session\nSuccessfully logged out\n```\n\nYou can see the datasets to which you've been given access using the `datasets` command:\n\n```console\n$ apheris datasets list\n+-----+---------------------------------------------------------+--------------+---------------------------+\n| idx |                        dataset_id                       | organization |       data custodian      |\n+-----+---------------------------------------------------------+--------------+---------------------------+\n|  0  |          cancer-medical-images_gateway-2_org-2          |    Org 2     |        Orsino Hoek        |\n|  1  |          pneumonia-x-ray-images_gateway-2_org-2         |    Org 2     |        Orsino Hoek        |\n|  2  |            covid-19-patients_gateway-1_org-1            |    Org 1     |      Agathe McFarland     |\n|  3  | medical-decathlon-task004-hippocampus-a_gateway-1_org-1 |    Org 1     |      Agathe McFarland     |\n|  4  | medical-decathlon-task004-hippocampus-b_gateway-2_org-2 |    Org 2     |        Orsino Hoek        |\n| ... |                           ...                           |     ...      |            ...            |\n+-----+---------------------------------------------------------+--------------+---------------------------+\n```\n\nAnd you can see models using the `models` command:\n\n```console\n$ apheris models list\n+-----+---------------------------+-------------------------------------+\n|  id |            name           |               version               |\n+-----+---------------------------+-------------------------------------+\n|  0  |       apheris-nnunet      |                u.v.w                |\n|  1  |     apheris-statistics    |                x.y.z                |\n| ... |            ...            |                 ...                 |\n+-----+---------------------------+-------------------------------------+\n```\n\nYou can schedule a job on Apheris using the `job` command:\n\n```console\n$ apheris job schedule \\\n--dataset_ids medical-decathlon-task004-hippocampus-a_gateway-1_org-1,medical-decathlon-task004-hippocampus-b_gateway-2_org-2 \\\n--model_id apheris-nnunet \\\n--model_version x.y.z \\\n--payload '{\"mode\": \"training\", \"model_configuration\": \"2d\", \"dataset_id\": 4, \"num_rounds\": 1}'\nAbout to schedule job with parameters:\nDataset IDs: medical-decathlon-task004-hippocampus-a_gateway-1_org-1,medical-decathlon-task004-hippocampus-b_gateway-2_org-2\nModel: apheris-nnunet:x.y.z\nPayload: {\"mode\": \"training\", \"model_configuration\": \"2d\", \"dataset_id\": 4, \"num_rounds\": 1}\nResources:\n  Client: 1.0 CPU, 0 GPU, 2000 MB memory\n  Server: 1.0 CPU, 0 GPU, 2000 MB memory\n\nDo you want to proceed? (y/N)\n:y\n\nThe job was submitted! The job ID is d6f7b657-8b30-4636-8f4c-2d96678095ba\n```\n\nCheck the status of a job:\n\n```console\n$ apheris job status\n\nUsing the cached `compute_spec_id` defe5013-2c73-4eb9-be52-1ae7aed841ff [2025-07-08 17:17:06].\nUsing the cached `job_id` f77d5dc7-a2e7-4a2a-827d-49a2131b1ffe [stored 2025-07-08 17:36:26].\n\nstatus: running\n```\n\nOnce a job is complete, you can download the results:\n\n```console\n$ apheris job download-results /path/to/store/results\n\nUsing the cached `compute_spec_id` defe5013-2c73-4eb9-be52-1ae7aed841ff [2025-07-08 17:17:06].\nUsing the cached `job_id` f77d5dc7-a2e7-4a2a-827d-49a2131b1ffe [stored 2025-07-08 17:36:26].\n\nSuccessfully downloaded job outputs to /path/to/store/results\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Apheris CLI package for interaction with the Apheris product.",
    "version": "0.38.0",
    "project_urls": null,
    "split_keywords": [
        "python",
        " apheris",
        " federated learning"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "47c432a3a9beef77e7aee796be850ea765923c130420251dc12c1256d10e7b28",
                "md5": "6352325ad706e9ebe3d29d8d57b7fcbe",
                "sha256": "e907ac7e60ab1da1cb19847dff26362015e93b5e94cbcf56e64b37659f30dc65"
            },
            "downloads": -1,
            "filename": "apheris_cli-0.38.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6352325ad706e9ebe3d29d8d57b7fcbe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 47967,
            "upload_time": "2025-07-28T10:23:27",
            "upload_time_iso_8601": "2025-07-28T10:23:27.548321Z",
            "url": "https://files.pythonhosted.org/packages/47/c4/32a3a9beef77e7aee796be850ea765923c130420251dc12c1256d10e7b28/apheris_cli-0.38.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-28 10:23:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "apheris-cli"
}
        
Elapsed time: 0.61152s