Skip to content

client

konigle.client

Main client classes for the Konigle SDK.

This module provides the primary Client and AsyncClient classes that serve as the main entry points for interacting with the Konigle API.

AsyncClient

Main asynchronous client for Konigle API.

This client provides async access to all Konigle API resources through dedicated async manager objects. It handles session management and configuration automatically.

Example

async with konigle.AsyncClient(api_key="your-api-key") as client: products = await client.products.list() product = await client.products.get("product-id")

__aenter__() async

Async context manager entry.

__aexit__(exc_type, exc_val, exc_tb) async

Async context manager exit with cleanup.

__init__(api_key, base_url=BASE_URL, timeout=30.0, retry_count=3, retry_backoff=0.5, max_connections=100, keepalive_connections=20, user_agent=None, log_level='WARNING', log_requests=False, log_responses=False, enable_retry=True, **kwargs)

Initialize the async Konigle client.

PARAMETER DESCRIPTION
api_key

Konigle API key for authentication

TYPE: str

base_url

Base URL for the Konigle API

TYPE: Optional[str] DEFAULT: BASE_URL

timeout

Request timeout in seconds

TYPE: Optional[float] DEFAULT: 30.0

retry_count

Number of retries for failed requests

TYPE: Optional[int] DEFAULT: 3

retry_backoff

Base backoff time for exponential retry

TYPE: Optional[float] DEFAULT: 0.5

max_connections

Maximum number of HTTP connections in pool

TYPE: Optional[int] DEFAULT: 100

keepalive_connections

Number of connections to keep alive

TYPE: Optional[int] DEFAULT: 20

user_agent

Custom user agent string

TYPE: Optional[str] DEFAULT: None

log_level

Logging level (DEBUG, INFO, WARNING, ERROR)

TYPE: Optional[str] DEFAULT: 'WARNING'

log_requests

Whether to log HTTP requests

TYPE: Optional[bool] DEFAULT: False

log_responses

Whether to log HTTP responses

TYPE: Optional[bool] DEFAULT: False

enable_retry

Whether to enable automatic retries

TYPE: Optional[bool] DEFAULT: True

**kwargs

Additional configuration options

DEFAULT: {}

aclose() async

Close the async client and cleanup resources.

from_env() classmethod

Create async client from environment variables.

Environment variables should be prefixed with KONIQ_.

RETURNS DESCRIPTION
AsyncClient

AsyncClient instance configured from environment variables

Client

Main synchronous client for Konigle API.

This client provides access to all Konigle API resources through dedicated manager objects. It handles session management and configuration automatically.

Example:

import konigle

client = konigle.Client(api_key="your-api-key")
products = client.products.list()
product = client.products.get("product-id")

__enter__()

Context manager entry.

__exit__(exc_type, exc_val, exc_tb)

Context manager exit with cleanup.

__init__(api_key, base_url=BASE_URL, timeout=30.0, retry_count=3, retry_backoff=0.5, max_connections=100, keepalive_connections=20, user_agent=None, log_level='WARNING', log_requests=False, log_responses=False, enable_retry=True, **kwargs)

Initialize the Konigle client.

PARAMETER DESCRIPTION
api_key

Konigle API key for authentication

TYPE: str

base_url

Base URL for the Konigle API

TYPE: Optional[str] DEFAULT: BASE_URL

timeout

Request timeout in seconds

TYPE: Optional[float] DEFAULT: 30.0

retry_count

Number of retries for failed requests

TYPE: Optional[int] DEFAULT: 3

retry_backoff

Base backoff time for exponential retry

TYPE: Optional[float] DEFAULT: 0.5

max_connections

Maximum number of HTTP connections in pool

TYPE: Optional[int] DEFAULT: 100

keepalive_connections

Number of connections to keep alive

TYPE: Optional[int] DEFAULT: 20

user_agent

Custom user agent string

TYPE: Optional[str] DEFAULT: None

log_level

Logging level (DEBUG, INFO, WARNING, ERROR)

TYPE: Optional[str] DEFAULT: 'WARNING'

log_requests

Whether to log HTTP requests

TYPE: Optional[bool] DEFAULT: False

log_responses

Whether to log HTTP responses

TYPE: Optional[bool] DEFAULT: False

enable_retry

Whether to enable automatic retries

TYPE: Optional[bool] DEFAULT: True

**kwargs

Additional configuration options

DEFAULT: {}

close()

Close the client and cleanup resources.

from_env() classmethod

Create client from environment variables.

Environment variables should be prefixed with KONIQ_.

RETURNS DESCRIPTION
Client

Client instance configured from environment variables