Metadata-Version: 2.4
Name: openkitx403-client
Version: 0.1.4
Summary: Python client SDK for OpenKitx403 wallet authentication
License: MIT
Author: OpenKitx403 Contributors
Author-email: team@openkitx403.dev
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: base58 (>=2.1.1,<3.0.0)
Requires-Dist: pynacl (>=1.5.0,<2.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: solders (>=0.18.1,<0.19.0)
Project-URL: Documentation, https://openkitx403.github.io/openkitx403-docs
Project-URL: Homepage, https://www.openkitx403.dev
Project-URL: Repository, https://github.com/openkitx403/openkitx403
Description-Content-Type: text/markdown

# openkitx403-client — Python SDK

Lightweight **Python client** for authenticating with **OpenKitx403**-protected APIs using Solana wallets.

---

## 🚀 Installation

```bash
pip install openkitx403-client
# or
poetry add openkitx403-client
```

---

## ⚡ Quick Start

```python
import asyncio
from nacl.signing import SigningKey
import base58
from openkitx403_client import OpenKit403Client


async def main():
    # Generate or load signing key (use secure storage in production)
    signing_key = SigningKey.generate()
    public_key = base58.b58encode(bytes(signing_key.verify_key)).decode()
    print(f"Wallet address: {public_key}")

    # Initialize client
    async with OpenKit403Client(signing_key) as client:
        # Authenticate against protected API
        result = await client.authenticate(
            resource="https://api.example.com/protected",
            method="GET",
        )

        if result.ok and result.response:
            data = await result.response.json()
            print("✅ Authenticated:", data)
        else:
            print("❌ Authentication failed:", result.error)


if __name__ == "__main__":
    asyncio.run(main())
```

---

## 🧩 API Overview

### `OpenKit403Client(signing_key: SigningKey)`

Authenticate any Python-based agent or service using a Solana wallet key.

**Key Methods:**

| Method                                                          | Description                             |
| --------------------------------------------------------------- | --------------------------------------- |
| `authenticate(resource, method='GET', headers=None, body=None)` | Authenticates and executes a request    |
| `create_challenge(resource, method)`                            | Returns the authentication challenge    |
| `sign_challenge(challenge)`                                     | Signs the challenge with the wallet key |

---

## 📚 Documentation

* [**Usage Examples → Python Client**](../../USAGE_EXAMPLES.md#4-python-client)
* [**Protocol Specification**](../../docs/SPEC.md)
* [**Security Guide**](../../SECURITY.md)

---

## 🪪 License

[MIT](../../LICENSE)


