Skip to main content

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
  • timeoutS (int, optional, default: 60): Request timeout in seconds
  • maximumRetries (int, optional, default: 5): How many times to try again in case of a failure due to connection or unavailability problems
  • initialRetryDelayS (int, optional, default: 1): The initial delay between successive retries in seconds.
  • maximumRetryDelayS (int, optional, default: 60): The maximum delay between successive retries in seconds.
  • session (requests.Session, optional, default: requests.Session()): A session object to use for all API calls.

Furthermore, the following methods are exposed:

  • accesstoken: Get a currently valid accesstoken
  • 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


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.9.4.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eniris-0.9.4-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file eniris-0.9.4.tar.gz.

File metadata

  • Download URL: eniris-0.9.4.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for eniris-0.9.4.tar.gz
Algorithm Hash digest
SHA256 4d281e3d380ce65308c1f12f87d9548c95917dc8ef01266397dc0381b16104be
MD5 9604fd24e633e8fe9ea65acd70aa26ff
BLAKE2b-256 cce3182531dfe46b07f3b804a5c58d09392ca4d5e538484478bc32428e9e9f64

See more details on using hashes here.

File details

Details for the file eniris-0.9.4-py3-none-any.whl.

File metadata

  • Download URL: eniris-0.9.4-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for eniris-0.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7e95ad4b286aae020e0b70d32dd68ca024a905839b3ad6e4828685b7c8db6227
MD5 0c5d5ae14693607b5b9ae4a44dc6272d
BLAKE2b-256 b37ca7e62a20eb66f5e83f0d4d3c7bf27c2a4d86f4a9d01c6c265b08c6cbe964

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page