Features
Python SDK
A typed, sync and async Python client for sending transactional email, scheduling sends, and verifying webhooks.
Sync or async, one client
The mailkube Python SDK is fully typed and gives you Mailkube for synchronous code and AsyncMailkube for async, with the same method surface either way. Install it and send your first message in a few lines.
from mailkube import Mailkube
with Mailkube() as client:
email = client.emails.send(
from_="Acme <hello@yourdomain.com>",
to="customer@example.com",
subject="Hello world",
html="<p>It works!</p>",
)
print("sent:", email.id)
What the SDK gives you
- Sync or async, same client shape.
MailkubeandAsyncMailkubeshare an identical method surface, so moving a codebase from sync to async is a client swap, not a rewrite. - Scheduled sends built in. Pass
scheduled_atonemails.send, then manage the queue withclient.scheduled_emails, including batch reschedule and cancel through a sharedbatch_id. - Webhook verification with no framework glue.
mailkube.verify(raw_body, headers, signing_secret)is a pure stdlib helper that works the same whether the receiver is Flask, FastAPI, or something custom. - Safe to retry. An
idempotency_keyon every send means a retried request after a timeout can’t double-send, and a typed error hierarchy makes failures easy to branch on.
What’s next
- Read the Python SDK docs for templates, attachments, tags, and the full error reference
- Follow the FastAPI guide if you’re building on FastAPI
- Follow Getting started to send your first email in minutes