Klink Finance Python SDK
Official Python SDK for the Klink platform. This SDK provides a simple and consistent interface for both Publishers and Advertisers to integrate with Klink's API.
Features
- 🚀 Easy to use - Simple initialization and intuitive API
- 🔐 Built-in authentication - Automatic request signing and auth headers
- 📝 Full type hints - Complete type annotations for better IDE support
- 🐛 Debug mode - Detailed logging for troubleshooting
- ⚡ Lightweight - Minimal dependencies (only requests library)
- 🐍 Python 3.8+ - Modern Python with dataclasses and type hints
Installation
pip install klinkfinance-sdk
Requirements
- Python >= 3.8
- requests >= 2.28.0
Quick Start
Basic Usage (Publisher)
from klinkfinance_sdk import KlinkSDK
# Initialize SDK using factory method - performs health check before initialization
# SDK will only be created if health check returns status 200
client = KlinkSDK.create({
"api_key": "your-api-key",
"api_secret": "your-api-secret", # Required for Publisher
})
# Use the publisher client
publisher = client.publisher()
# Fetch offers
response = publisher.get_offers({
"page": 1,
"limit": 50,
"category": ["gaming", "finance"],
"country": "US",
"device_name": "android",
})
print(f"Fetched {len(response['data'])} offers")
Basic Usage (Advertiser)
from klinkfinance_sdk import KlinkSDK
# Initialize SDK - api_secret is optional for Advertiser
client = KlinkSDK.create({
"api_key": "your-api-key",
# "api_secret": "your-api-secret", # Optional for Advertiser
})
# Use the advertiser client
advertiser = client.advertiser()
# Send postback
advertiser.send_postback({
"event_name": "create_account",
"offer_id": "offer_123",
"sub1": "sub1_value",
"tx_id": "tx_123",
"isChargeback": False,
"chargebackReason": "",
"isTest": True,
})
Error Handling
from klinkfinance_sdk import (
KlinkSDK,
KlinkConfigException,
KlinkAuthException,
KlinkAPIException,
KlinkNetworkException,
)
try:
client = KlinkSDK.create({
"api_key": "invalid-key",
"api_secret": "invalid-secret",
})
except KlinkConfigException as e:
print(f"Configuration error: {e}")
except KlinkAuthException as e:
print(f"Authentication failed: {e}")
except KlinkAPIException as e:
print(f"API error: {e} (Status: {e.status_code})")
except KlinkNetworkException as e:
print(f"Network error: {e}")
License
MIT
Metadata
Release files for klinkfinance-sdk 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| klinkfinance_sdk-1.0.1.tar.gz | 23.1 kB | Without provenance | Details for klinkfinance_sdk-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| klinkfinance_sdk-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for klinkfinance_sdk-1.0.1-py3-none-any.whl |
Total release size: 53.2 kB
Release files / klinkfinance_sdk-1.0.1.tar.gz
| Download URL | klinkfinance_sdk-1.0.1.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
daef73db5bf4b31e058a51332249289decbb4cc80948d55bf1482da2d161f35c
|
|
BLAKE2b-256 checksum How to use checksums |
9866a28093bbce77f962f9ec0c401e0756ad47a9a8799a7d4fdb8b81bac782c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / klinkfinance_sdk-1.0.1-py3-none-any.whl
| Download URL | klinkfinance_sdk-1.0.1-py3-none-any.whl |
|---|---|
| Size | 30.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87baca9945c67bb046c8f87aba1664068bf8a0b9c57382d0727153afe97aa6ee
|
|
BLAKE2b-256 checksum How to use checksums |
4b9bd4113f9977dbb38a1e9622c9ae2821dfa61895298c6fc6f5ae040fb3fe69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for klinkfinance-sdk 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.