Skip to main content

Python SDK for the DeadDrop API — programmable email inboxes for the agentic era

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.1.0.tar.gz (10.0 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.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deaddropzone-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed18e8b9a6ce979a06122b87050e8a50362b049c4330f46304956f547892fa32
MD5 334df22d04325d87624e9f3d85a0a7eb
BLAKE2b-256 a568f9bfdd8bfeac79fd23f8dc487e4eeea80074ff4e03acca204219102d7741

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deaddropzone-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9236c06ede9ee658c45b14c40fb7ae36ba962050634a1a2d9363fdc5b49a9e36
MD5 12ea08352fa1a288f6f6609fe4201e96
BLAKE2b-256 2bfa8a5437f9f253a73015d0a997181d8a2e7858afefd59cb507eff7d8eae4ad

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