Name | metis-client JSON |
Version |
0.7.1
JSON |
| download |
home_page | |
Summary | Metis infra API client in Python |
upload_time | 2024-02-12 15:24:05 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8 |
license | |
keywords |
metis
client
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Metis API client
[![DOI](https://zenodo.org/badge/563802198.svg)](https://doi.org/10.5281/zenodo.7693569)
[![PyPI](https://img.shields.io/pypi/v/metis_client.svg?style=flat)](https://pypi.org/project/metis-client)
<p align="center"><img src="https://github.com/metis-science/metis-client/blob/master/metis-client.png" width="300" /></p>
This library allows for programmatic interactions with the [Metis infrastructure](https://github.com/basf/metis-bff).
## 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:
```python
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:
```python
from metis_client import MetisAPI, MetisTokenAuth
client = MetisAPI(API_URL, auth=MetisTokenAuth("VERY_SECRET_TOKEN"), timeout=5)
data = client.v0.datasources.create(content)
results = client.v0.calculations.create_get_results(data["id"], timeout=False)
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).
## Contributing
Please give a minute to the [contribution guide](https://github.com/metis-science/metis-client/blob/master/CONTRIBUTING.md). Note, that our [changelog](https://github.com/metis-science/metis-client/blob/master/CHANGELOG.md) is maintained fully automatically via [GitHub actions](https://github.com/metis-science/metis-client/tree/master/.github/workflows).
## License
Author Sergey Korolev, Tilde Materials Informatics
Copyright 2023 BASF SE
BSD 3-Clause
Raw data
{
"_id": null,
"home_page": "",
"name": "metis-client",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "metis,client",
"author": "",
"author_email": "Sergei Korolev <knopki@duck.com>",
"download_url": "https://files.pythonhosted.org/packages/78/31/0999a32fcb055cd5ee97eee3214853d073be8097d1f96c7f21b3b6fe2b2b/metis_client-0.7.1.tar.gz",
"platform": null,
"description": "# Metis API client\n\n[![DOI](https://zenodo.org/badge/563802198.svg)](https://doi.org/10.5281/zenodo.7693569)\n[![PyPI](https://img.shields.io/pypi/v/metis_client.svg?style=flat)](https://pypi.org/project/metis-client)\n\n<p align=\"center\"><img src=\"https://github.com/metis-science/metis-client/blob/master/metis-client.png\" width=\"300\" /></p>\n\nThis library allows for programmatic interactions with the [Metis infrastructure](https://github.com/basf/metis-bff).\n\n\n## Installation\n\n`pip install metis_client`\n\n## Usage\n\nThere are two client flavors: **asyncronous** `asyncio` client\nand simplified **synchronous** client.\n\n### Asynchronous client\n\nAn asynchronous client is `MetisAPIAsync`. Example of usage:\n\n```python\nfrom metis_client import MetisAPIAsync, MetisTokenAuth\n\nasync def main():\n async with MetisAPIAsync(API_URL, auth=MetisTokenAuth(\"VERY_SECRET_TOKEN\")) as client:\n print(await client.v0.auth.whoami())\n data = await client.v0.datasources.create(content)\n results = await client.v0.calculations.create_get_results(data[\"id\"])\n print(resuls)\n```\n\nSee `examples` directory for more examples.\n\n### Synchronous client\n\nA synchronous client is `MetisAPI`. Example of usage:\n\n```python\nfrom metis_client import MetisAPI, MetisTokenAuth\n\nclient = MetisAPI(API_URL, auth=MetisTokenAuth(\"VERY_SECRET_TOKEN\"), timeout=5)\ndata = client.v0.datasources.create(content)\nresults = client.v0.calculations.create_get_results(data[\"id\"], timeout=False)\nprint(results)\n```\n\nNB in development one can replace a `VERY_SECRET_TOKEN` string with the development user email, e.g.\n`admin@test.com` (refer to **users_emails** BFF table).\n\n\n## Contributing\n\nPlease give a minute to the [contribution guide](https://github.com/metis-science/metis-client/blob/master/CONTRIBUTING.md). Note, that our [changelog](https://github.com/metis-science/metis-client/blob/master/CHANGELOG.md) is maintained fully automatically via [GitHub actions](https://github.com/metis-science/metis-client/tree/master/.github/workflows).\n\n\n## License\n\nAuthor Sergey Korolev, Tilde Materials Informatics\n\nCopyright 2023 BASF SE\n\nBSD 3-Clause\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Metis infra API client in Python",
"version": "0.7.1",
"project_urls": {
"Changelog": "https://github.com/tilde-lab/metis-client/blob/master/CHANGELOG.md",
"Home": "https://github.com/tilde-lab/metis-client",
"Issues": "https://github.com/tilde-lab/metis-client/issues",
"Source": "https://github.com/tilde-lab/metis-client"
},
"split_keywords": [
"metis",
"client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f1c7340e89787eba947f0faed4dc88834d2488867114cef4188f754569c19a1d",
"md5": "73db1f06828360faf3e848b878680ca1",
"sha256": "97a067bef6aeb321e043a47de967b44fcc1e8cd72defaf742264abfb443d35d9"
},
"downloads": -1,
"filename": "metis_client-0.7.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "73db1f06828360faf3e848b878680ca1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 30744,
"upload_time": "2024-02-12T15:24:03",
"upload_time_iso_8601": "2024-02-12T15:24:03.047463Z",
"url": "https://files.pythonhosted.org/packages/f1/c7/340e89787eba947f0faed4dc88834d2488867114cef4188f754569c19a1d/metis_client-0.7.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "78310999a32fcb055cd5ee97eee3214853d073be8097d1f96c7f21b3b6fe2b2b",
"md5": "993e5c83937ff15f0ef68fd2c35910e6",
"sha256": "874942f7c8b23121267859d8b737a81080e9323891719f57f0dc054cc9136e9d"
},
"downloads": -1,
"filename": "metis_client-0.7.1.tar.gz",
"has_sig": false,
"md5_digest": "993e5c83937ff15f0ef68fd2c35910e6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 82111,
"upload_time": "2024-02-12T15:24:05",
"upload_time_iso_8601": "2024-02-12T15:24:05.745439Z",
"url": "https://files.pythonhosted.org/packages/78/31/0999a32fcb055cd5ee97eee3214853d073be8097d1f96c7f21b3b6fe2b2b/metis_client-0.7.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-12 15:24:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tilde-lab",
"github_project": "metis-client",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "metis-client"
}