Skip to main content

Plop Python SDK

The official Python SDK for Plop — receive and poll for emails in your tests and applications.

Installation

pip install plop-sdk

Quick Start

from plop_sdk import Plop

# Reads PLOP_API_KEY from environment if not provided
plop = Plop(api_key="plop_...")

# List mailboxes
mailboxes = plop.mailboxes.list()

# List messages
messages = plop.messages.list(mailbox="qa", tag="login", limit=10)

# Get a specific message
message = plop.messages.get("message-uuid")

# Get the latest message
latest = plop.messages.latest(mailbox="qa", tag="otp")

# Wait for an email (polls until match or timeout)
email = plop.messages.wait_for(
    mailbox="qa",
    tag="verification",
    timeout=30,
    interval=1.0,
)

Async Usage

from plop_sdk import AsyncPlop

async with AsyncPlop() as plop:
    email = await plop.messages.wait_for(mailbox="qa", tag="login")
    messages = await plop.messages.list(mailbox="qa")

Webhook Verification

from plop_sdk import Plop

plop = Plop()

is_valid = plop.webhooks.verify(
    secret="whsec_...",
    signature=request.headers["x-plop-signature"],
    body=raw_body,
)

Error Handling

from plop_sdk import Plop, PlopError, PlopNotFoundError, PlopTimeoutError

plop = Plop()

try:
    message = plop.messages.get("nonexistent-id")
except PlopNotFoundError:
    print("Message not found")
except PlopError as e:
    print(f"API error: {e.message} (status={e.status})")

Configuration

Parameter Environment Variable Default
api_key PLOP_API_KEY Required
base_url PLOP_BASE_URL https://api.plop.email
timeout - 30.0 seconds

License

MIT

Download files

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

Source Distribution

plop_sdk-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

plop_sdk-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plop_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plop_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fd8d6c34fe5360c6537aaa9fe0c5c4559b50bb22cf4d2893e314436f967000a0
MD5 87924a40eb6fd53123c7875d4baa3aa9
BLAKE2b-256 5bf5dd757091a991ecbe752add63e4c382991e402dac565ec27eb5b976ae19f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for plop_sdk-0.1.0.tar.gz:

Publisher: publish.yml on plop-email/plop-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: plop_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plop_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86d8dd3aea29306f0c53b13f75fdbd82f7d22778f4bf9da6337d6b457942db37
MD5 8984ebdf749046db5c517cceb4ae8902
BLAKE2b-256 596ae8e371a68b51fd2c1dccc42153d0a1eeecf7c36f0864e38538a9ddde3c01

See more details on using hashes here.

Provenance

The following attestation bundles were made for plop_sdk-0.1.0-py3-none-any.whl:

Publisher: publish.yml on plop-email/plop-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

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