Metadata-Version: 2.4
Name: netsware-sdk
Version: 2.0.0
Summary: Official Netsware SDK — Business Hours + Scheduled Jobs APIs
Author: Netsware Systems LLP
License: MIT
Project-URL: Homepage, https://netsware.com
Project-URL: Documentation, https://netsware.com/dashboard/docs
Keywords: netsware,business-hours,scheduled-jobs,webhooks,cron
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# netsware-sdk

Official Python SDK for the [Netsware](https://netsware.com) API — Business Hours,
Scheduled Jobs, and Webhooks. Pure standard library, no dependencies.

## Install

```bash
pip install netsware-sdk
```

## Quickstart

```python
from netsware import Netsware, verify_webhook

client = Netsware("nw_live_xxx")

# Is a business open right now?
status = client.hours.check(timezone="Asia/Kolkata", country="IN")
print(status["open"])

# Create a business-hours schedule
sched = client.hours.create_schedule(
    name="Mumbai office",
    days=["MON", "TUE", "WED", "THU", "FRI"],
    open_time="09:00",
    close_time="18:00",
    timezone="Asia/Kolkata",
    country="IN",
)

# Schedule a one-time job
job = client.jobs.schedule(
    name="Send reminder",
    url="https://example.com/webhook",
    run_at="2026-07-01T09:00:00",
    timezone="Asia/Kolkata",
    payload={"user_id": "123"},
)

# Register a webhook (one event per registration)
hook = client.webhooks.register(
    product="scheduled_jobs",
    event="job.completed",
    url="https://example.com/events",
)
```

## Verifying webhook signatures

Pass the **raw** request body string for a byte-exact check:

```python
ok = verify_webhook(
    payload=raw_body,                       # raw request body (string)
    signature=headers["X-Netsware-Signature"],
    timestamp=headers["X-Netsware-Timestamp"],
    secret="whsec_...",
)
if not ok:
    ...  # reject
```

## Configuration

```python
client = Netsware("nw_live_xxx", base_url="https://app.netsware.com", timeout=30.0)
```

Full API reference: <https://netsware.com/dashboard/docs>.

MIT © Netsware Systems LLP
