Skip to main content

Async Python Client for Kong

PyPI version Python versions Build codecov Downloads

Tested with kong v3.8

Installation

To install the package

pip install aio-kong

Testing

To run tests, clone the repository and

make install
make test

:warning: If you don't have Kong or postgres running locally, run the services first

make services

test certificates were generated using the command

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -subj '/CN=localhost'

Client

The client can be imported via

from kong.client import Kong

In a coroutine:

async with Kong() as cli:
    services = await cli.services.get_list()
    print(json.dumps([s.data for s in services], indent=2))

By default the url is obtained from the "KONG_ADMIN_URL" environment variable which defaults to http://127.0.0.1:8001.

The client has handlers for all Kong objects

Apply a configuration

The client allow to apply a configuration object to kong:

await cli.apply_json(config)

Command line tool

The library can install the kongfig command line tool for uploading kong configuration files.

For the command line tool to work, you need to install the package as:

pip install aio-kong[cli]

and to run the cli tool, you can use the following command:

kongfig --help

Environment variables

The client uses the following environment variables:

  • KONG_ADMIN_URL: The URL of the Kong admin API. Defaults to http://127.0.0.1:8001.
  • KONG_ADMIN_SSL: Whether to use SSL validation for the Kong admin API. Defaults to true.

Metadata

Release files for aio-kong 3.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aio-kong 3.7.2
File Size Uploaded
aio_kong-3.7.2.tar.gz 10.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aio-kong 3.7.2
File Interpreter ABI Platform
aio_kong-3.7.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.2 kB

Release files / aio_kong-3.7.2.tar.gz

Download URL aio_kong-3.7.2.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a352f82d0b1d5f9463811907bfff1be87e5fc30a4b46995befbe542d2ab0e2d9
BLAKE2b-256 checksum
How to use checksums
8cd0a865675829a03e3216e3062250f259927ae365b7944f3976aff4834eb411
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1015-azure

Release files / aio_kong-3.7.2-py3-none-any.whl

Download URL aio_kong-3.7.2-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28be9455bc5fb23d0ac132b6ea46be54fefdf4330cd3c887adf8b9d028a62b48
BLAKE2b-256 checksum
How to use checksums
8f59c68e470bf5e714da90ac3854e8d50d60b8d5691ba3bff86a711fe0741dce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1015-azure

Release history Release notifications | RSS feed

This release

3.7.2 This release

2 release files

3.7.1

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.0.0

2 release files

2.8.2

2 release files

2.8.1

2 release files

2.8.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

5 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

3 release files

0.6.0

3 release files

0.5.4

3 release files

0.5.3

3 release files

0.5.2

3 release files

0.5.1

3 release files

0.5.0

3 release files

0.4.0

3 release files

0.3.3

3 release files

0.3.2

3 release files

0.3.1

3 release files

0.3.0

3 release files

0.2.8

3 release files

0.2.7

3 release files

0.2.6

3 release files

0.2.5

3 release files

0.2.4

3 release files

0.2.3

3 release files

0.2.2

3 release files

0.2.1

3 release files

0.2.0

3 release files

0.1.3

3 release files

0.1.2

3 release files

0.1.1

3 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page