Official Python SDK for Duta — transactional email for developers.
Project description
Duta Python SDK
Official Python client for Duta. Zero dependencies, standard library only.
Install
pip install duta-sdk
Quickstart
from duta import Duta
duta = Duta("duta_live_xxx")
result = duta.emails.send({
"from": "hello@yourdomain.com",
"to": "user@example.com",
"subject": "Welcome to Duta",
"html": "<p>Thanks for signing up!</p>",
})
print("Sent:", result["id"])
Get an API key from the dashboard. The sender domain must be verified first.
Error handling
Methods raise DutaError on failure:
from duta import Duta, DutaError
duta = Duta("duta_live_xxx")
try:
duta.emails.send({ "from": "...", "to": "...", "subject": "Hi", "text": "Hello" })
except DutaError as e:
print(e.status_code, e.name, e.message)
# e.name: authentication_error | permission_denied | rate_limit_exceeded | ...
API
Duta(api_key, base_url=..., timeout=30.0)
duta.emails.send(params)
params keys: from, to (str or list), subject, html, text, reply_to, tags (dict). Returns a dict with id and status.
duta.emails.get(email_id)
Retrieve one email. Requires a full-access API key.
duta.emails.list(page=1, limit=20)
List emails, newest first. Requires a full-access API key.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duta_sdk-0.1.0.tar.gz.
File metadata
- Download URL: duta_sdk-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5304c4d376bab452c4ced707a4c3ce15d1a44b3e65e0037b5dcf23e17036c810
|
|
| MD5 |
ae7b03972fd2a7f71ae8ff897b2ad2eb
|
|
| BLAKE2b-256 |
6639c96ca97e5103610405511e6c14bb23b4bca0078828c788b5b9b0940c242d
|
File details
Details for the file duta_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: duta_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8108f893c041b97f757b3312052ae64063febaec010d8c06f22ea9470351e1ad
|
|
| MD5 |
6917f8ecc0cbc285a949bbb995786ca6
|
|
| BLAKE2b-256 |
1bd3d68d88b0887790ffe24e90dd1490bab63ccee090c047ef1b3fc04e78affe
|