Metadata-Version: 2.0
Name: python-mlboardclient
Version: 1.0.7
Summary: Ml-Board Client Library
Home-page: UNKNOWN
Author: KuberLab
Author-email: UNKNOWN
License: Apache Software License
Description-Content-Type: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Requires-Dist: PyYAML (>=3.10.0)
Requires-Dist: bayesian-optimization
Requires-Dist: pbr (!=2.1.0,>=2.0.0)
Requires-Dist: requests (>=2.14.2)
Requires-Dist: six (>=1.9.0)
Requires-Dist: subprocess32; (python_version < '3')

# python-mlboardclient

[![Pypi](https://img.shields.io/badge/pypi-python--mlboardclient-green.svg)](https://pypi.python.org/pypi/python-mlboardclient)

Python lib for interacting ml-board component.

## Installation

### From PyPi

```bash
pip install python-mlboardclient
```

### From github (fresh master branch)

```bash
pip install 'git+https://github.com/kuberlab/python-mlboardclient.git'
```

## Usage

```python
from mlboardclient.api import client

# Default url is http://mlboard-v2.kuberlab:8082/api/v2
# No need to pass any url if instantiate client from ml-project (Jupyter/Task)
ml = client.Client()
apps = ml.apps.list()
[<mlboardclient.api.v2.apps.App object at 0x7f0b554b5f90>]

app = apps[0]
# Get tasks from config
app.tasks
[<Task name=model build=None status=undefined>]

task = app.tasks[0]

# Run & wait task
task.run()
<Task name=model build=4 status=Succeeded>

# Get tasks from API
app.get_tasks()
[<Task name=model build=1 status=Failed>, <Task name=model build=2 status=Failed>,
<Task name=model build=3 status=Failed>, <Task name=model build=4 status=Succeeded>]
```

### Model upload

```python
    ml.model_upload('my-model', '1.0.0', '/model/dir')
    # If the model uploading is not executing in scope of project task,
    # need to specify workspace_name and project_name explicitly:
    ml.model_upload(
        'my-model',
        '1.0.0',
        '/model/dir',
        workspace_name='demo',
        project_name='test-project
    )

    # Wait until model is being uploaded.
```



