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-v2
Usage
from gundi_client_v2 import GundiClient
import httpx
# You can use it as an async context-managed client
async with GundiClient() as client:
try:
connection = await client.get_connection_details(
integration_id="some-integration-uuid"
)
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:
for integration in connection.destinations:
...
...
# Or create an instance and close the client explicitly later
client = GundiClient()
try:
response = await client.get_connection_details(
integration_id="some-integration-uuid"
)
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:
for integration in connection.destinations:
...
...
await client.close() # Close the session used to send requests to Gundi
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
gundi_client_v2-2.1.2.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for gundi_client_v2-2.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc3ce3cb3356ab8cc6785d6d9f329892434020248f6f2cf1359b57eb8b5ee5d6 |
|
MD5 | 0dd8c0d8a8d1a26e43b85f00d23148d6 |
|
BLAKE2b-256 | b3d3d07015dfab9d5f5e5d0dc2edd2f702299df356096da901645a108204d917 |