Metis infra API client in Python
Project description
Metis API client
This library allows for programmatic interactions with the Metis infrastructure.
Installation
pip install metis_client
Usage
There are two client flavors: asyncronous asyncio
client
and simplified synchronous client.
Asynchronous client
An asynchronous client is MetisAPIAsync
. Example of usage:
from metis_client import MetisAPIAsync, MetisTokenAuth
async def main():
async with MetisAPIAsync(API_URL, auth=MetisTokenAuth("VERY_SECRET_TOKEN")) as client:
print(await client.v0.auth.whoami())
data = await client.v0.datasources.create(content)
results = await client.v0.calculations.create_get_results(data["id"])
print(resuls)
See examples
directory for more examples.
Synchronous client
A synchronous client is MetisAPI
. Example of usage:
from metis_client import MetisAPI, MetisTokenAuth
client = MetisAPI(API_URL, auth=MetisTokenAuth("VERY_SECRET_TOKEN"))
data = client.v0.datasources.create(content)
results = client.v0.calculations.create_get_results(data["id"])
print(results)
NB in development one can replace a VERY_SECRET_TOKEN
string with the development user email, e.g.
admin@test.com
(refer to users_emails BFF table).
License
Author Sergey Korolev, Tilde Materials Informatics
Copyright 2023 BASF SE
BSD 3-Clause
- [ ]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
metis_client-0.3.0.tar.gz
(35.4 kB
view hashes)
Built Distribution
Close
Hashes for metis_client-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52ae43528a7abbc51c37ae7acee25a2b99d17449c6355af28d048150051927e4 |
|
MD5 | a7ff224d7a875c49dcd5d7b6703e28a6 |
|
BLAKE2b-256 | 4b9464a46181c66caec5001bbaa2bcfeb7cafbcad4c3ca9b268d080eb2a7c73f |