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

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.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gundi_client-1.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file gundi_client-1.1.0.tar.gz.

File metadata

  • Download URL: gundi_client-1.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for gundi_client-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b2db5b0e3f0e08cf0bb78ae79d2a47dc7e93fb3d22a95c42d31efc361a44986c
MD5 d67728d892046758e52c9f50dd9ce4af
BLAKE2b-256 c844f829d88520c424660652eec9bf7f370c678cb4bd070e115ca2e2c0cea7ae

See more details on using hashes here.

File details

Details for the file gundi_client-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: gundi_client-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for gundi_client-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b04fd57e2a119f7428e4cb2f78caaa5e2085533c92b0f4415cb54672e443f14
MD5 35548a1784885114789b275024c36c46
BLAKE2b-256 e15302633103c8054fc804adddf5c19dc6067604a3032ef390c4003775a0b45b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page