Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duta_sdk-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duta_sdk-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

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

Hashes for duta_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5304c4d376bab452c4ced707a4c3ce15d1a44b3e65e0037b5dcf23e17036c810
MD5 ae7b03972fd2a7f71ae8ff897b2ad2eb
BLAKE2b-256 6639c96ca97e5103610405511e6c14bb23b4bca0078828c788b5b9b0940c242d

See more details on using hashes here.

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

Hashes for duta_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8108f893c041b97f757b3312052ae64063febaec010d8c06f22ea9470351e1ad
MD5 6917f8ecc0cbc285a949bbb995786ca6
BLAKE2b-256 1bd3d68d88b0887790ffe24e90dd1490bab63ccee090c047ef1b3fc04e78affe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page