Eniris API driver for Python
Project description
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. It offers users an interface which is inspired by the popular requests library.
Installation
To install the latest stable version, use:
pip install eniris
Quick Example
from eniris import ApiDriver
driver = ApiDriver("myUsername", "myPassword")
http_response = driver.get("/v1/device")
response_body = http_response.json()
print(response_body['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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
eniris-0.3.2.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file eniris-0.3.2.tar.gz
.
File metadata
- Download URL: eniris-0.3.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62367de9d6b4ac60587481a155d9c12372c20161b1eb42918c6cc6e435b7605a |
|
MD5 | 5d49b42b6d7386084fbb9a4b673f3311 |
|
BLAKE2b-256 | ccefc2841bb72e28af385f0713ed14e2bf24e35f97064870ccc77f776a7ffaec |
File details
Details for the file eniris-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: eniris-0.3.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2d12de07b471370c2ea0596c6c6fc5a62e64b6fd7af4ac5eeda8fa310967f91 |
|
MD5 | bc544f614b35773b3ca138d76b2c832b |
|
BLAKE2b-256 | 30bfc19f040b00e6868db0bd0908d4711a813ddbf125f03a2942ed9784a13d68 |