eniris


Nameeniris JSON
Version 0.8.16 PyPI version JSON
download
home_pagehttps://github.com/eniris-international/eniris-api-python-driver
SummaryEniris API driver for Python
upload_time2024-03-23 18:21:47
maintainerNone
docs_urlNone
authorEnris BV
requires_pythonNone
licenseMIT
keywords eniris api rest
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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")
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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eniris-international/eniris-api-python-driver",
    "name": "eniris",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "eniris, api, rest",
    "author": "Enris BV",
    "author_email": "info@eniris.be",
    "download_url": "https://files.pythonhosted.org/packages/cd/49/5c3d06b2f50e379ca29844a3ef807a8554289aacb6663d67f5404947cf40/eniris-0.8.16.tar.gz",
    "platform": null,
    "description": "# Eniris API driver for Python\nThis 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.\n\n## Installation\nTo install the latest stable version, use:\n```sh\npip install eniris\n```\n## Quick Example\n```python\nfrom eniris import ApiDriver\n\ndriver = ApiDriver(\"myUsername\", \"myPassword\")\nhttp_response = driver.get(\"/v1/device\")\nresponse_body = http_response.json()\nprint(response_body['device'][:10])\ndriver.close()\n```\n## Details\nThe driver constructor accepts the following arguments:\n- username (string, required)\n- password (string, required)\n- authUrl (string, optional, default: 'https://authentication.eniris.be'): URL of authentication endpoint\n- apiUrl (string, optional, default: 'https://api.eniris.be'): URL of api endpoint\n- timeoutS (int, optional, default: 60): Request timeout in seconds\n- maximumRetries (int, optional, default: 5): How many times to try again in case of a failure due to connection or unavailability problems\n- initialRetryDelayS (int, optional, default: 1): The initial delay between successive retries in seconds.\n- maximumRetryDelayS (int, optional, default: 60): The maximum delay between successive retries in seconds.\n- session (requests.Session, optional, default: requests.Session()): A session object to use for all API calls.\n\nFurthermore, the following methods are exposed:\n- accesstoken: Get a currently valid accesstoken\n- get/delete: Send a HTTP GET/DELETE request. The following parameters are allowed:\n  - path (string, required): Either a path relative to the apiUrl, or a full URL path\n  - params (dict, optional, default: None): URL query parameters\n- post/put: Send a HTTP POST or PUT request. The following parameters are allowed:\n  - path (string, required): Either a path relative to the apiUrl, or a full URL path\n  - json (dict, optional, default: None): JSON body of the request. The json argument and the data argument cannot both be different from None\n  - params (dict, optional, default: None): URL query parameters\n  - data (string or dict, optional, default: None): Payload of the request. The json argument and the data argument cannot both be different from None\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Eniris API driver for Python",
    "version": "0.8.16",
    "project_urls": {
        "Download": "https://github.com/eniris-international/eniris-api-python-driver/archive/refs/tags/v0.8.16.tar.gz",
        "Homepage": "https://github.com/eniris-international/eniris-api-python-driver"
    },
    "split_keywords": [
        "eniris",
        " api",
        " rest"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f2b51f0527889f82a93db0d683dadd4d8ebaa246c1719944bc3548af5d8a78a",
                "md5": "eea07fd35d3d05bef8538eea71c4b992",
                "sha256": "4299a4cb1478379f23bfffa45acc1ab89b9bb36fce520b28dc6d89833dbd1451"
            },
            "downloads": -1,
            "filename": "eniris-0.8.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eea07fd35d3d05bef8538eea71c4b992",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 32380,
            "upload_time": "2024-03-23T18:21:45",
            "upload_time_iso_8601": "2024-03-23T18:21:45.261667Z",
            "url": "https://files.pythonhosted.org/packages/6f/2b/51f0527889f82a93db0d683dadd4d8ebaa246c1719944bc3548af5d8a78a/eniris-0.8.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd495c3d06b2f50e379ca29844a3ef807a8554289aacb6663d67f5404947cf40",
                "md5": "06bf6a5e2c439bdd52d188aa6ce3bf4a",
                "sha256": "252697d933d05be5c7e694a3ad7eb56e3acc63bc04d7c64012203faf05f56d29"
            },
            "downloads": -1,
            "filename": "eniris-0.8.16.tar.gz",
            "has_sig": false,
            "md5_digest": "06bf6a5e2c439bdd52d188aa6ce3bf4a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26583,
            "upload_time": "2024-03-23T18:21:47",
            "upload_time_iso_8601": "2024-03-23T18:21:47.122119Z",
            "url": "https://files.pythonhosted.org/packages/cd/49/5c3d06b2f50e379ca29844a3ef807a8554289aacb6663d67f5404947cf40/eniris-0.8.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-23 18:21:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eniris-international",
    "github_project": "eniris-api-python-driver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "eniris"
}
        
Elapsed time: 0.21207s