Metadata-Version: 2.4
Name: pilot-status
Version: 0.1.0
Summary: Official Python SDK for the Pilot Status public API.
Author: Pilot Status
License: MIT
Project-URL: Homepage, https://pilotstatus.online
Project-URL: Repository, https://github.com/pilot-status/pilot-status
Project-URL: Issues, https://github.com/pilot-status/pilot-status/issues
Keywords: pilot-status,whatsapp,api,sdk,python
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# pilot-status (Python SDK)

SDK oficial em Python para consumir a API pública do Pilot Status.

## Instalação

```bash
pip install pilot-status
```

## Uso

Crie uma API key no painel e use somente no backend.

```python
import os

from pilot_status import PilotStatusClient

client = PilotStatusClient(
    api_key=os.environ["PILOT_STATUS_API_KEY"],
)

accepted = client.messages.send(
    {
        "templateId": "onboarding-test",
        "destinationNumber": "+5511999999999",
        "variables": {"name": "João"},
    }
)

message = client.messages.get(accepted["id"])
print(message["status"])
```

## Analytics

```python
stats = client.analytics.get_dashboard_stats(tz="America/Sao_Paulo")
print(stats["totalSent"], stats["failureRate"])
```

## Webhooks (parse/validação)

```python
from pilot_status import parse_customer_webhook

def handler(payload: dict):
    event = parse_customer_webhook(payload)

    if event["event"] == "message.failed":
        print(event["data"]["errorMessage"])
```

