Plop Python SDK — receive and poll for emails in your tests and applications
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd8d6c34fe5360c6537aaa9fe0c5c4559b50bb22cf4d2893e314436f967000a0
|
|
| MD5 |
87924a40eb6fd53123c7875d4baa3aa9
|
|
| BLAKE2b-256 |
5bf5dd757091a991ecbe752add63e4c382991e402dac565ec27eb5b976ae19f5
|
Provenance
The following attestation bundles were made for plop_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on plop-email/plop-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plop_sdk-0.1.0.tar.gz -
Subject digest:
fd8d6c34fe5360c6537aaa9fe0c5c4559b50bb22cf4d2893e314436f967000a0 - Sigstore transparency entry: 925853016
- Sigstore integration time:
-
Permalink:
plop-email/plop-python@5aa9a9b1d61c4ef25f3e4a7a70b1f8ca7503d52c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/plop-email
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5aa9a9b1d61c4ef25f3e4a7a70b1f8ca7503d52c -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86d8dd3aea29306f0c53b13f75fdbd82f7d22778f4bf9da6337d6b457942db37
|
|
| MD5 |
8984ebdf749046db5c517cceb4ae8902
|
|
| BLAKE2b-256 |
596ae8e371a68b51fd2c1dccc42153d0a1eeecf7c36f0864e38538a9ddde3c01
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plop_sdk-0.1.0-py3-none-any.whl -
Subject digest:
86d8dd3aea29306f0c53b13f75fdbd82f7d22778f4bf9da6337d6b457942db37 - Sigstore transparency entry: 925853025
- Sigstore integration time:
-
Permalink:
plop-email/plop-python@5aa9a9b1d61c4ef25f3e4a7a70b1f8ca7503d52c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/plop-email
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5aa9a9b1d61c4ef25f3e4a7a70b1f8ca7503d52c -
Trigger Event:
release
-
Statement type: