Metadata-Version: 2.1
Name: aiolancium
Version: 0.1.0
Summary: AsyncIO Client for Lancium
License: MIT
Keywords: asyncio,lancium,compute client
Author: Manuel Giffels
Author-email: giffels@gmail.com
Requires-Python: >=3.6.2,<4.0.0
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet :: WWW/HTTP :: Session
Classifier: Topic :: Utilities
Provides-Extra: doc
Provides-Extra: test
Requires-Dist: aioresponses (>=0.7.3,<0.8.0); extra == "test"
Requires-Dist: black (<=22.8.0); extra == "test"
Requires-Dist: flake8 (>=5.0.4,<6.0.0); extra == "test"
Requires-Dist: flake8-bugbear (==22.9.23); extra == "test"
Requires-Dist: jsonref (>=1.0.0,<2.0.0)
Requires-Dist: simple-rest-client (==0.5.4)
Requires-Dist: sphinx (==4.3.1); extra == "doc"
Requires-Dist: sphinx-rtd-theme (>=1.1.1,<2.0.0); extra == "doc"
Requires-Dist: sphinxcontrib-contentui (>=0.2.5,<0.3.0); extra == "doc"
Description-Content-Type: text/markdown

[![Build Status](https://github.com/giffels/aiolancium/actions/workflows/unittests.yaml/badge.svg)](https://github.com/giffels/aiolancium/actions/workflows/unittests.yaml)
[![Verification](https://github.com/giffels/aiolancium/actions/workflows/verification.yaml/badge.svg)](https://github.com/giffels/aiolancium/actions/workflows/verification.yaml)
[![codecov](https://codecov.io/gh/giffels/aiolancium/branch/main/graph/badge.svg)](https://codecov.io/gh/giffels/aiolancium)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/giffels/aiolancium/blob/master/LICENSE)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# aiolancium

aiolancium is a simplistic python REST client for the Lancium Compute REST API utilizing asyncio. The client itself has
been developed against the [Lancium Compute REST API documentation](https://lancium.github.io/compute-api-docs/api.html).

## Installation
aiolancium can be installed via [PyPi](https://pypi.org/) using

```bash
pip install aiolancium
```

## How to use aiolancium

```python
from aiolancium.auth import Authenticator
from aiolancium.client import LanciumClient

# Authenticate yourself against the API and refresh your token if necessary
auth = Authenticator(api_key="<your_api_key>")

# Initialise the actual client
client = LanciumClient(api_url="https://portal.lancium.com/api/v1/", auth=auth)

# List details about the `lancium/ubuntu` container
await client.images.list_image("lancium/ubuntu")

# Create your hellow world first job.
job = {"job": {"name": "GridKa Test Job",
                   "qos": "high",
                   "image": "lancium/ubuntu",
                   "command_line": 'echo "Hello World"',
                   "max_run_time": 600}}

await client.jobs.create_job(**job)

# Show all your jobs and their status in Lancium compute
jobs = await client.jobs.show_jobs()

# Delete all your jobs in Lancium compute
for job in jobs["jobs"]:
    await client.jobs.delete_job(id=job["id"])
```

