An async client for Gundi's API
Project description
Gundi Client
Introduction
Gundi, a.k.a "The Portal" is a platform to manage integrations. The gundi-client is an async python client to interact with Gundi's REST API.
Installation
pip install gundi-client
Usage
from gundi_client import PortalApi
import httpx
# You can use it as an async context-managed client
async with PortalApi() as portal:
try:
response = await portal.get_outbound_integration_list(
session=session, inbound_id=str(inbound_id), device_id=str(device_id)
)
except httpx.RequestError as e:
logger.exception("Request Error")
...
except httpx.TimeoutException as e:
logger.exception("Request timed out")
...
except httpx.HTTPStatusError as e:
logger.exception("Response returned error")
else:
# response contains a list configs as dicts
for integration in response:
...
...
# Or create an instance and close the client explicitly later
portal = PortalApi()
try:
response = await portal.get_outbound_integration_list(
session=session, inbound_id=str(inbound_id), device_id=str(device_id)
)
except httpx.RequestError as e:
logger.exception("Request Error")
...
except httpx.TimeoutException as e:
logger.exception("Request timed out")
...
except httpx.HTTPStatusError as e:
logger.exception("Response returned error")
else:
# response contains a list configs as dicts
for integration in response:
...
...
await portal.close() # Close the session used to send requests to ER API
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
gundi_client-1.0.4.tar.gz
(8.6 kB
view details)
Built Distribution
File details
Details for the file gundi_client-1.0.4.tar.gz
.
File metadata
- Download URL: gundi_client-1.0.4.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.28.1 setuptools/66.1.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02fbffd3cc726dfd536827de85ea837409e20fea93f8cc76b0d2f4c4ff983734 |
|
MD5 | 51cdc49705fcd7c5a5623ad61ab0a652 |
|
BLAKE2b-256 | d0537d109b30a6fd55546b94eb22f8f554854e420b547685ef9c75bc33f9aa7c |
File details
Details for the file gundi_client-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: gundi_client-1.0.4-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.28.1 setuptools/66.1.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 590592afa427db64ded3b4fb54cd6582c5836e6335258f4772b5c45889ccc602 |
|
MD5 | 341c5a112318646fa46167ece0d4b9a3 |
|
BLAKE2b-256 | e49f2d9b91d1303d26ca1c36e09aab870d23ebd0105611abfcad1d2518738798 |