Metadata-Version: 2.4
Name: servizehub
Version: 1.1.0
Summary: Official Python SDK for ServizeHub
Author: Hariraghav S
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0

# ServizeHub SDK

## Install
Install using pip:

```bash
pip install servizehub
```

Requires Python 3.8+ and `httpx>=0.24.0` (installed automatically).

## Usage

```python
import asyncio
from servizehub import VendorClient

client = VendorClient("vnd_test_12345")

async def main():
    response = await client.send_booking(
        "2026-04-15",
        "Photography",
        "available"
    )
    print(response)

asyncio.run(main())
```

## Configuration

| Argument   | Required | Default                                   | Description                                  |
| ---------- | -------- | ----------------------------------------- | -------------------------------------------- |
| `api_key`  | Yes      | —                                         | Your ServizeHub vendor API key.               |
| `base_url` | No       | `https://service.servizehub.com/external` | API base URL. Override to target another environment. |

### Environments

Leave `base_url` out and the SDK talks to **production**:

```python
# production — https://service.servizehub.com/external
client = VendorClient("vnd_live_key")
```

Pass `base_url` to point the SDK at another environment, such as **dev**:

```python
# dev — https://servizehubuserdev.notasco.in/external
client = VendorClient(
    "vnd_test_key",
    base_url="https://servizehubuserdev.notasco.in/external"
)
```

Notes:

- `base_url` is the full base **including** the `/external` path segment. Endpoints
  are appended to it, e.g. `{base_url}/capture-availability`.
- Trailing slashes are stripped, so `.../external/` and `.../external` behave the same.
- The default is importable as `servizehub.DEFAULT_BASE_URL`.

Keep the URL out of your source by reading it from the environment:

```python
import os
from servizehub import VendorClient

client = VendorClient(
    os.environ["SERVIZEHUB_API_KEY"],
    base_url=os.getenv("SERVIZEHUB_BASE_URL")  # None -> production
)
```

## Methods

### `await send_booking(date, service_type, status)`

Sends a single availability update. `date` must be `YYYY-MM-DD` and `status` must be
`available` or `unavailable`.

### `await send_multiple_bookings(bookings)`

Sends a list of bookings and returns
`{"message": ..., "successfulBookings": [...], "failedBookings": [...]}`.

```python
bookings = [
    {"date": "2026-04-15", "serviceType": "Photography", "status": "available"},
    {"date": "2026-04-16", "serviceType": "Videography", "status": "unavailable"},
]
response = await client.send_multiple_bookings(bookings)
```

## Tests

```bash
python -m unittest discover -s tests
```

Uses the standard library `unittest` — no extra dependencies required.
`Test.py` is a manual smoke script that hits a real environment.

## 📩 License

Created by Notasco Dev Team

Happy Coding! 🎯
