Metadata-Version: 2.1
Name: eniris
Version: 0.2.2
Summary: Eniris API driver for Python
Home-page: https://github.com/eniris-international/eniris-api-python-driver
Download-URL: https://github.com/eniris-international/eniris-api-python-driver/archive/refs/tags/v0.1.0.tar.gz
Author: Enris BV
Author-email: info@eniris.be
License: MIT
Keywords: eniris,api,rest
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE

# Eniris API driver for Python
This repository contains the official Eniris API driver for Python. This driver takes care of authentication as well as request retries and timeouts, in accordance with the [authentication API documentation](https://authentication.eniris.be/docs). It offers users an interface which is inspired by the popular [requests](https://requests.readthedocs.io/en/latest/) library.

## Installation
To install the latest stable version, use:
```sh
pip install eniris
```
## Quick Example
```python
from eniris import ApiDriver

driver = ApiDriver("myUsername", "myPassword")
http_response = driver.get("/v1/device")
print(http_response['device'][:10])
driver.close()
```
## Details
The driver constructor accepts the following arguments:
- username (string, required)
- password (string, required)
- authUrl (string, optional, default: 'https://authentication.eniris.be'): URL of authentication endpoint
- apiUrl (string, optional, default: 'https://api.eniris.be'): URL of api endpoint
- maxRetries (int, optional, default: 5): How many times to try again in case of a failure due to connection or unavailability problems
- timeoutS (int, optional, default: 60): Request timeout in seconds

Furthermore, the following methods are exposed:
- get/delete: Send a HTTP GET/DELETE request. The following parameters are allowed:
  - path (string, required): Either a path relative to the apiUrl, or a full URL path
  - params (dict, optional, default: None): URL query parameters
- post/put: Send a HTTP POST or PUT request. The following parameters are allowed:
  - path (string, required): Either a path relative to the apiUrl, or a full URL path
  - json (dict, optional, default: None): JSON body of the request. The json argument and the data argument cannot both be different from None
  - params (dict, optional, default: None): URL query parameters
  - data (string or dict, optional, default: None): Payload of the request. The json argument and the data argument cannot both be different from None
