OpenSend includes a minimal first-party Python SDK package at
packages/python-sdk for Resend-shaped
transactional email sends.
Use your OpenSend API key (os_...) with the Resend-compatible API surface.
From this repository:
python -m pip install ./packages/python-sdkThe package metadata is prepared for future publishing as opensend, but this
change does not publish to PyPI.
Store API keys in environment variables; do not hardcode real keys.
export OPENSEND_API_KEY="os_your_api_key"
export OPENSEND_BASE_URL="http://localhost:3015" # optional for self-hostingIf OPENSEND_BASE_URL is unset, the SDK targets https://api.opensend.com.
import os
import opensend
opensend.api_key = os.environ["OPENSEND_API_KEY"]
opensend.base_url = os.environ.get("OPENSEND_BASE_URL", opensend.DEFAULT_BASE_URL)
params: opensend.Emails.SendParams = {
"from": "hello@yourdomain.com",
"to": "recipient@example.com",
"subject": "Hello from OpenSend",
"html": "<h1>It works!</h1>",
}
email = opensend.Emails.send(params)
print(email["id"])result = opensend.Emails.send_batch([
{
"from": "hello@yourdomain.com",
"to": "a@example.com",
"subject": "Hello A",
"html": "<p>A</p>",
},
{
"from": "hello@yourdomain.com",
"to": "b@example.com",
"subject": "Hello B",
"html": "<p>B</p>",
},
])Non-2xx responses raise opensend.OpenSendError with status_code, name,
code, message, and details fields when the OpenSend API error envelope
includes them.