Metadata-Version: 2.5
Name: mailofly
Version: 0.2.0
Summary: Official Python client for the Mailofly REST API.
Project-URL: Homepage, https://docs.mailofly.com/sdks/python
Project-URL: Documentation, https://docs.mailofly.com/sdks/python
Project-URL: Repository, https://github.com/teamredevs/mailofly-python
Project-URL: Issues, https://github.com/teamredevs/mailofly-python/issues
Project-URL: Changelog, https://github.com/teamredevs/mailofly-python/blob/main/CHANGELOG.md
Author: Mailofly
License-Expression: MIT
License-File: LICENSE
Keywords: api,client,email,mailofly,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# mailofly

Official **Python** client for the [Mailofly REST API](https://docs.mailofly.com/api).

Requires **Python 3.9+**.

> **Source of truth:** developed in the [mailofly monorepo](https://github.com/godstark82/mailofly) under `packages/python`. This public repo is mirrored automatically on change.

## Install

```bash
pip install mailofly
```

## Usage

```python
import os
from mailofly import Mailofly, MailoflyError

client = Mailofly(os.environ["MAILOFLY_API_KEY"])

try:
    result = client.emails.send({
        "from": "Acme <onboarding@example.com>",
        "to": ["you@example.com"],
        "subject": "Hello",
        "html": "<p>Hi from Mailofly</p>",
    })
    print(result["id"])
except MailoflyError as e:
    print(e.status, e.error, e.detail_message)

# Batch (up to 100 emails)
batch = client.batch.send([
    {"from": "Acme <onboarding@example.com>", "to": ["a@b.com"], "subject": "Hi", "html": "<p>1</p>"},
    {"from": "Acme <onboarding@example.com>", "to": ["c@d.com"], "subject": "Hi", "html": "<p>2</p>"},
])
print(batch["data"])
```

## Docs

- [Python guide](https://docs.mailofly.com/sdks/python)
- [API reference](https://docs.mailofly.com/api)

## Releasing

1. Bump `version` in `pyproject.toml` (and this changelog) in the **monorepo** PR.
2. Merge to `main`/`master` → GitHub Action syncs this folder to `teamredevs/mailofly-python`.
3. Publish workflow runs and publishes to PyPI only when the version is new.

## License

MIT
