Metadata-Version: 2.4
Name: mailhub-sdk
Version: 0.2.0
Summary: The official Python library for the Mailhub API
Requires-Python: >=3.10,<4.0
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: Programming Language :: Python :: 3.14
Requires-Dist: httpx (>=0.21.2)
Requires-Dist: pydantic (>=1.9.2)
Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
Requires-Dist: typing_extensions (>=4.0.0)
Description-Content-Type: text/markdown

# MailHub Python SDK

Official Python SDK for the MailHub Partner API.

## Requirements

- Python 3.10+

## Installation

```sh
pip install mailhub-sdk
```

## Usage

```python
from mailhub import MailhubClient

client = MailhubClient(
    api_key="YOUR_API_KEY",
    base_url="https://api.mailhub.co.kr",
)

client.message.send_message(
    to_email="user@example.com",
    from_email="noreply@example.com",
    subject="Hello from MailHub",
    body="<p>Hello!</p>",
)
```

## Available Resources

The client exposes one sub-client per resource:

```
client.campaign
client.contact
client.custom_field
client.media
client.message
client.segment
client.template
```

## Error Handling

Non-2XX responses raise an `ApiError` (from `mailhub.core`, not the `mailhub.types.ApiError` response model), which exposes the HTTP status code and the response body:

```python
from mailhub.core import ApiError

try:
    client.message.send_message(to_email="user@example.com")
except ApiError as e:
    print(e.status_code)
    print(e.body)
```

## License

MIT

