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.1.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file gundi_client_v2-2.1.1.tar.gz
.
File metadata
- Download URL: gundi_client_v2-2.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34a3364d6f11b19fc56257fc6323a20dc32505f7a0b50e47c0d81a2c48f9d6b |
|
MD5 | 0b6e5bbad008ad66e878c7d403c54f5d |
|
BLAKE2b-256 | 7d812751dba76e5c97c8b9a6b6d9680e943d483625a0a4f3cd10667dce19ca0e |
Provenance
File details
Details for the file gundi_client_v2-2.1.1-py3-none-any.whl
.
File metadata
- Download URL: gundi_client_v2-2.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20615cd4f8f0968122a631aecb036df2912b82139cbe55ca67f6721b3bb5ecaf |
|
MD5 | ad08ac9583941b6290a7a5ce5ca28734 |
|
BLAKE2b-256 | fa28fe1547422450c1731fc69bdb67d1456f2c278af217a509f545ad4bff7d67 |