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.5.tar.gz (4.4 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.5-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file duta_sdk-0.1.5.tar.gz.

File metadata

  • Download URL: duta_sdk-0.1.5.tar.gz
  • Upload date:
  • Size: 4.4 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.5.tar.gz
Algorithm Hash digest
SHA256 0a807ae979ef4db1d1a591d0ab28d28842da9cb2036170bc35d2811ff58783d5
MD5 1026d8676272d22d221f3d87412a848a
BLAKE2b-256 2c6e2c02ce62166c3014ab98613c0a9cfd54f62550d563f1e01c09511e0d5a0f

See more details on using hashes here.

File details

Details for the file duta_sdk-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: duta_sdk-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.3 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 615f4e7a03e92801318b232168e2f181386e6e5f3fdc2b3b9881ff9cb98e3375
MD5 5cfd4a9e7e3e7853b5422656e6ef8626
BLAKE2b-256 067207405810407103cb6c3e622edbc4da4a01e5c5d5f3360ead9423cad091a9

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