Metadata-Version: 2.4
Name: kortana-dev-sdk
Version: 1.0.0
Summary: Official Kortana SDK for Python
License: MIT
Author: Kortana Labs
Author-email: engineering@kortana.io
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: anyio (>=4.0.0,<5.0.0)
Requires-Dist: cryptography (>=42.0.0,<43.0.0)
Requires-Dist: httpx (>=0.27.0,<0.28.0)
Requires-Dist: pydantic (>=2.5.0,<3.0.0)
Requires-Dist: pydantic-settings (>=2.1.0,<3.0.0)
Project-URL: Homepage, https://docs.kortana.io/sdk/python
Project-URL: Repository, https://github.com/kortana-labs/sdk-python
Description-Content-Type: text/markdown

# kortana-dev-sdk — Official Kortana Python SDK

[![PyPI](https://img.shields.io/pypi/v/kortana-dev-sdk)](https://pypi.org/project/kortana-dev-sdk/)
[![Python](https://img.shields.io/pypi/pyversions/kortana-dev-sdk)](https://pypi.org/project/kortana-dev-sdk/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

The official Python SDK for the [Kortana](https://kortana.io) blockchain payments platform.

## Installation

```bash
pip install kortana-dev-sdk
# or
poetry add kortana-dev-sdk
```

## Quick Start

```python
import asyncio
import os
from kortana import kortana

async def main():
    async with kortana(
        api_key=os.environ["KORTANA_API_KEY"],
        environment="mainnet",
    ) as client:
        # Check network status
        status = await client.blockchain.get_network_status()
        print(f"Block: {status.block_number}")

        # Get wallet balance
        balance = await client.wallets.get_balance()
        print(f"Balance: {balance.available} DNR")

        # Create a payment link
        link = await client.payments.create_link(
            amount=1_000_000_000_000_000_000,  # 1 DNR in wei
            currency="DNR",
            description="Invoice #1001",
        )
        print(f"Payment URL: {link.url}")

asyncio.run(main())
```

## Webhook Verification

```python
from kortana import kortana

client = kortana(api_key="kt_live_...", webhook_secret="whsec_...")

@app.post("/webhooks")
async def handle_webhook(request: Request):
    payload = await request.body()
    signature = request.headers.get("X-Kortana-Signature", "")
    event = client.validate_webhook(payload.decode(), signature)
    if event["type"] == "transfer.completed":
        print("Transfer done!", event["data"])
    return {"received": True}
```

## Modules

| Module | Description |
|---|---|
| `client.blockchain` | Read-only blockchain data (blocks, txs, gas) |
| `client.contracts` | Deploy and interact with smart contracts |
| `client.wallets` | HD wallet management and transfers |
| `client.payments` | Payment intents, invoices, subscriptions |
| `client.banking` | Customer and bank account management |
| `client.cards` | Virtual and physical card issuance |
| `client.compliance` | KYC, KYB, and AML screening |
| `client.settlement` | Ledger settlement and treasury |
| `client.merchants` | Merchant onboarding and management |

## Requirements

- Python 3.9+
- `httpx >= 0.27`
- `pydantic >= 2.5`

## License

MIT © Kortana Labs

