Metadata-Version: 2.4
Name: hxtpy
Version: 1.1.1
Summary: Official HxTP/3.0 Python SDK — Protocol reference engine, AI integration layer, automation glue, provisioning toolkit.
Project-URL: Homepage, https://github.com/hestialabs/hxtpy
Project-URL: Documentation, https://docs.hestialabs.in/
Project-URL: Repository, https://github.com/hestialabs/hxtpy
Project-URL: Issues, https://github.com/hestialabs/hxtpy/issues
Author-email: Hestia Labs <contact@hestialabs.in>
License-Expression: MIT
License-File: LICENSE
Keywords: automation,embedded,hmac,hxtpy,iot,mqtt,protocol,security
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Networking
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: websockets>=12.0
Provides-Extra: all
Requires-Dist: gmqtt>=0.6.0; extra == 'all'
Requires-Dist: mypy>=1.8; extra == 'all'
Requires-Dist: pytest-asyncio>=0.23; extra == 'all'
Requires-Dist: pytest>=8.0; extra == 'all'
Requires-Dist: ruff>=0.3; extra == 'all'
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.3; extra == 'dev'
Provides-Extra: mqtt
Requires-Dist: gmqtt>=0.6.0; extra == 'mqtt'
Description-Content-Type: text/markdown

# HXTP Python SDK

[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://python.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Version](https://img.shields.io/badge/version-1.1.1-blue.svg)](https://pypi.org/project/hxtpy/)

**HxTP/3.1** Python Client SDK — A high-performance implementation of the HMAC-SHA256 signed IoT protocol. Features bit-perfect parity with Go, JS, and C++ implementations.

---

## Installation

```bash
pip install hxtpy
```

---

## Quick Start

### Async Client with MQTT Transport

```python
import asyncio
from hxtpy.client import HxTPClient
from hxtpy.transport.mqtt import MQTTTransport
from decimal import Decimal

async def main():
    # 1. Initialize the Protocol-Bound Client
    client = HxTPClient(
        url="https://api.hestialabs.in/api/v1",
        tenant_id="your-tenant-uuid",
        device_id="your-device-uuid",
        client_id="unique-client-id",
        secret="64-char-hex-secret",
    )

    # 2. Use high-performance MQTT transport
    mqtt = MQTTTransport(url="tcp://broker.hestialabs.in:1883")
    client.set_transport(mqtt)
    
    await mqtt.connect()

    # 3. Send a signed command with numeric precision
    response = await client.send_command(
        device_id="light-1",
        action="set_level",
        params={"brightness": Decimal("85.50")} # Bit-perfect decimal parity
    )
    
    print(f"✅ Sent: {response.message_id}")

async def run():
    await main()

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

---

## 🔐 Protocol Alignment: HxTP/3.1

This SDK implements HxTP/3.1 with **bit-perfect parity** across the execution stack.

| Component | Status | Details |
| :--- | :--- | :--- |
| **Framing** | ✅ | Pipe-separated (`|`) with mandatory backslash escaping. |
| **Normalization** | ✅ | Mandatory **Unicode NFC** normalization for all fields. |
| **Numbers** | ✅ | Deterministic decimal strings via `Decimal`. |
| **Compliance** | ✅ | Verified against the cross-language compliance suite. |

---

## License

MIT License — Copyright (c) 2026 Hestia Labs
