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:
|
base_url
|
Base URL for the Konigle API
TYPE:
|
timeout
|
Request timeout in seconds
TYPE:
|
retry_count
|
Number of retries for failed requests
TYPE:
|
retry_backoff
|
Base backoff time for exponential retry
TYPE:
|
max_connections
|
Maximum number of HTTP connections in pool
TYPE:
|
keepalive_connections
|
Number of connections to keep alive
TYPE:
|
user_agent
|
Custom user agent string
TYPE:
|
log_level
|
Logging level (DEBUG, INFO, WARNING, ERROR)
TYPE:
|
log_requests
|
Whether to log HTTP requests
TYPE:
|
log_responses
|
Whether to log HTTP responses
TYPE:
|
enable_retry
|
Whether to enable automatic retries
TYPE:
|
**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:
|
base_url
|
Base URL for the Konigle API
TYPE:
|
timeout
|
Request timeout in seconds
TYPE:
|
retry_count
|
Number of retries for failed requests
TYPE:
|
retry_backoff
|
Base backoff time for exponential retry
TYPE:
|
max_connections
|
Maximum number of HTTP connections in pool
TYPE:
|
keepalive_connections
|
Number of connections to keep alive
TYPE:
|
user_agent
|
Custom user agent string
TYPE:
|
log_level
|
Logging level (DEBUG, INFO, WARNING, ERROR)
TYPE:
|
log_requests
|
Whether to log HTTP requests
TYPE:
|
log_responses
|
Whether to log HTTP responses
TYPE:
|
enable_retry
|
Whether to enable automatic retries
TYPE:
|
**kwargs
|
Additional configuration options
DEFAULT:
|
close()
¶
Close the client and cleanup resources.