Python SDK
The official Python client. Zero dependencies, standard library only.
Install
Section titled “Install”pip install duta-sdkfrom duta import Duta
duta = Duta("duta_live_xxx")
result = duta.emails.send({ "from": "hello@yourdomain.com", "to": "user@example.com", "subject": "Welcome", "html": "<p>Thanks for signing up!</p>",})print("Sent:", result["id"])Error handling
Section titled “Error handling”Methods raise DutaError on failure:
from duta import Duta, DutaError
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 | ...Methods
Section titled “Methods”duta.emails.send(params): send an email.paramskeys:from,to(str or list),subject,html,text,reply_to,tags.duta.emails.get(email_id): retrieve an email. Requires a full-access key.duta.emails.list(page=1, limit=20): list emails. Requires a full-access key.
Package: pypi.org/project/duta-sdk · Source: github.com/indra-sh/duta-python.