Skip to main content

Python SDK for DeadDrop — receive-only email inboxes for AI agents

Project description

DeadDrop Python SDK

Python client for the DeadDrop API — programmable email inboxes for the agentic era.

Install

pip install deaddropzone

The distribution name is deaddropzone (the deaddrop name on PyPI is taken), but the import name is still deaddrop:

from deaddrop import DeadDrop

Quick start

from deaddrop import DeadDrop

dd = DeadDrop(api_key="dd_live_...")

# Create an inbox
inbox = dd.create_inbox(slug="my-signup-test")
print(f"Send email to: {inbox.address}")

# Wait for an OTP (blocks until one arrives or timeout)
otp = dd.wait_for_otp(inbox.id, timeout=60)
print(f"Got OTP: {otp.value}")

# Wait for a verification link
link = dd.wait_for_link(inbox.id, "verification", timeout=60)
print(f"Verify at: {link.url}")

Ephemeral inboxes (no auth)

from deaddrop import DeadDrop

dd = DeadDrop()  # no API key needed
inbox = dd.create_ephemeral_inbox()
# inbox expires in 1 hour

Configuration

Parameter Env var Default
api_key DEADDROP_API_KEY
base_url DEADDROP_API_URL https://api.deaddrop.zone

Convenience methods

The SDK provides high-level methods that compose the long-poll wait endpoint with extraction:

  • wait_for_message(inbox_id, ...) — Block until a message arrives matching filters.
  • wait_for_otp(inbox_id, ...) — Wait for a message with an OTP, return the highest-confidence match.
  • wait_for_link(inbox_id, link_type, ...) — Wait for a message with a specific link type.

All accept optional timeout, after, subject_contains, and from_contains filters.

Inbox pools

pool = dd.create_pool("ci-tests", target_size=5)
inbox = dd.checkout_inbox(pool.id)
# ... use inbox ...
dd.return_inbox(pool.id, inbox.id)

Error handling

from deaddrop import DeadDrop, DeadDropError
from deaddrop.errors import TimeoutError

dd = DeadDrop(api_key="dd_live_...")

try:
    otp = dd.wait_for_otp(inbox_id, timeout=10)
except TimeoutError:
    print("No OTP arrived in time")
except DeadDropError as e:
    print(f"API error: {e.code}{e.message}")

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

deaddropzone-0.2.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

deaddropzone-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file deaddropzone-0.2.0.tar.gz.

File metadata

  • Download URL: deaddropzone-0.2.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for deaddropzone-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fda2f5f855ac677592ad28daa6806fe32062661e6dc730c069c4f24a89747956
MD5 1f4981b32821abe852221091be3ac1c6
BLAKE2b-256 2ce38f1d0a020667ed3f85dd97b7f41d76c96bfd0cb661bf4eb38c8a1caa2c6b

See more details on using hashes here.

File details

Details for the file deaddropzone-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: deaddropzone-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for deaddropzone-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8da13de02430aa1a7660d32838360e94ef57cf6f98dba15b0a6ee9bad9f0cf3c
MD5 bcc745db667a3fc32fc13927dc3831b3
BLAKE2b-256 9b9bdfb399da2ba3255782bec43418d59f4ecec18115a118c0f57163bf1dbe6c

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