Metadata-Version: 2.4
Name: motorical
Version: 0.1.0
Summary: Official Python client for the Motorical transactional email API, Public API and Communications API, generated from the OpenAPI specification. Standard library only.
License: MIT
Project-URL: Documentation, https://docs.motorical.com/api-reference/endpoints#generate-a-client
Project-URL: Source, https://github.com/motorical-smtp/motorical-packages/tree/main/packages/motorical-sdk-python
Project-URL: Issues, https://github.com/motorical-smtp/motorical-packages/issues
Keywords: motorical,email,transactional email,smtp,email api,sdk
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# motorical (Python)

Python client for the Motorical APIs: the transactional Send API, the Public API (analytics, logs, domains, webhooks, Motor Blocks) and the Communications API. One method per `operationId` in [openapi.json](https://docs.motorical.com/openapi.json), in snake_case, generated from it. Standard library only (Python 3.8+).

```python
from motorical import Motorical, MotoricalError

m = Motorical(api_key="mk_live_...")  # Motor Block key
res = m.send_email(body={"from": "you@yourdomain.com", "to": "someone@example.com", "subject": "Hello", "text": "Hi", "dryRun": True})
```

**Arguments:** keyword arguments for path, query and header parameters (`id=`, `days=`; `webhook_id=` and `webhookId=` both work), the request body as `body=`, and `workspace_id=` for Communications calls.

**Credentials:** `api_key`, `bearer_token`, `account_key`, `dashboard_token`, `workspace_id`. Each method sends the credential its operation accepts.

**Errors** raise `MotoricalError` with `status`, `code` (branch on it: [error codes](https://docs.motorical.com/api-reference/errors)), `request_id` and `body`.

**A successful send is acceptance, not delivery:** read the outcome with `get_message` or a webhook.
