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")
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

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

Uploaded Source

Built Distribution

eniris-0.2.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eniris-0.2.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for eniris-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3093d4bdf40450a94b3c3624c94d5a6107d54fea22bf2598e9d95d909431b8ec
MD5 c8118e5e1e7c531b155561f23d3dc0c4
BLAKE2b-256 5c2bbfc8b6fb1b6fcc721ec985883f98b7fa8bed5f984f60828c0331075bfa81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eniris-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for eniris-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea7c122b4a9f934838c2b2547f0454d57273300683faeb7010560cd6d195d0cf
MD5 f81d204563073a012be6ba29d33657b2
BLAKE2b-256 dad4ad87405980f15cfc8d2b0200dfdd03cb2ab33ad0624454b8b82d1768c09d

See more details on using hashes here.

Supported by

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