Skip to main content

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


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.3.3.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

gundi_client_v2-2.3.3-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

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