Metadata-Version: 2.4
Name: absolidix-client
Version: 0.8.3
Summary: Absolidix infra API client in Python
Author-email: Sergei Korolev <knopki@duck.com>
License-Expression: BSD-3-Clause
Project-URL: Home, https://bitbucket.org/tilde-mi/absolidix-client
Project-URL: Changelog, https://bitbucket.org/tilde-mi/absolidix-client/blob/master/CHANGELOG.md
Project-URL: Issues, https://bitbucket.org/tilde-mi/absolidix-client/issues
Project-URL: Source, https://bitbucket.org/tilde-mi/absolidix-client
Keywords: absolidix,client
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.7.4
Requires-Dist: aiohttp-sse-client>=0.2.1
Requires-Dist: typing-extensions>=4.2.0; python_version < "3.11"
Requires-Dist: yarl>=1.6.3
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: commitizen; extra == "dev"
Requires-Dist: freezegun; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Requires-Dist: pytest-aiohttp<2,>=1.0.4; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: wdb; extra == "dev"
Dynamic: license-file

# Absolidix API client

[![DOI](https://zenodo.org/badge/563802198.svg)](https://doi.org/10.5281/zenodo.7693569)
[![PyPI](https://img.shields.io/pypi/v/absolidix_client.svg?style=flat)](https://pypi.org/project/absolidix-client)

This library allows for programmatic interactions with the Absolidix infrastructure.

## Installation

`pip install absolidix_client`

## Usage

There are two client flavors: **asyncronous** `asyncio` client
and simplified **synchronous** client.

### Asynchronous client

An asynchronous client is `AbsolidixAPIAsync`. Example of usage:

```python
from absolidix_client import AbsolidixAPIAsync, AbsolidixTokenAuth

async def main():
    async with AbsolidixAPIAsync(API_URL, auth=AbsolidixTokenAuth("VERY_SECRET_TOKEN")) as client:
        print(await client.v0.auth.whoami())
        data = await client.v0.datasources.create(content, name)
        results = await client.v0.calculations.create_get_results(data["id"])
        print(resuls)
```

See `examples` directory for more examples.

### Synchronous client

A synchronous client is `AbsolidixAPI`. Example of usage:

```python
from absolidix_client import AbsolidixAPI, AbsolidixTokenAuth

client = AbsolidixAPI(API_URL, auth=AbsolidixTokenAuth("VERY_SECRET_TOKEN"), timeout=5)
data = client.v0.datasources.create(content, name)
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](./CONTRIBUTING.md).

## License

Author Sergey Korolev, Tilde Materials Informatics

Copyright 2023-2024 BASF SE
Copyright 2024-2025 Tilde Materials Informatics

BSD 3-Clause
