Skip to main content

Official Robase.dev Python SDK — transactional email for Nigerian developers.

Project description

robasedev (Python)

Official Python SDK for Robase.dev — transactional email for Nigerian developers, API-compatible with Resend.

Install

pip install robasedev

Python 3.9+.

Quickstart

import os
from robasedev import Robase

client = Robase(api_key=os.environ["ROBASE_API_KEY"])

email = client.emails.send(
    from_="hello@acme.com",
    to="customer@example.com",
    subject="Welcome",
    html="<p>Thanks!</p>",
)
print(email["id"])

Configuration

client = Robase(
    api_key="sk_live_...",
    base_url="https://api.robase.dev",  # override for self-hosted
    timeout=30.0,
    max_retries=2,                     # 5xx / 429 / transport errors
)

Use as a context manager to close the underlying httpx client automatically:

with Robase(api_key=...) as client:
    client.emails.send(...)

Sending

client.emails.send(
    from_="hello@acme.com",
    to=["a@ex.com", "b@ex.com"],
    cc="c@ex.com",
    subject="Hi",
    html="<p>…</p>",
    text="fallback",
    reply_to="support@acme.com",
    headers={"X-Campaign": "spring"},
    tags={"campaign": "spring"},
    tracking={"opens": True, "clicks": True},
    attachments=[
        {"filename": "invoice.pdf", "content": b64_bytes, "content_type": "application/pdf"}
    ],
    scheduled_at="2026-05-01T09:00:00Z",
    idempotency_key="welcome-user-42",
)

Batch

out = client.emails.batch([
    {"from_": "a@ex.com", "to": "x@ex.com", "subject": "one", "text": "1"},
    {"from_": "a@ex.com", "to": "y@ex.com", "subject": "two", "text": "2"},
])
for item in out:
    if "error" in item:
        print("failed:", item["error"]["type"])
    else:
        print("queued:", item["id"])

Retrieve + cancel

client.emails.get("em_xyz")
client.emails.cancel("em_xyz")   # raises ValidationError if already sent

Errors

Class HTTP
AuthenticationError 401
NotFoundError 404
ValidationError 422 — inspect err.type to branch
RateLimitError 429 (err.retry_after in seconds)
ServerError 5xx

The client retries ServerError, RateLimitError, and transport failures with exponential backoff + jitter.

Webhook verification

from robasedev import verify_webhook_signature

@app.post("/webhooks/robase")
async def hook(request):
    body = await request.body()  # raw bytes
    verify_webhook_signature(
        payload=body,
        header=request.headers["Robase-Signature"],
        secret=os.environ["ROBASE_WEBHOOK_SECRET"],
    )
    event = json.loads(body)
    ...

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

robasedev-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

robasedev-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for robasedev-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b460b9492f36344456de32f0663aebfd3f316ece8f76f110843e2dbb134cf56
MD5 facf71cbb65756acc2e9df5b4e3acb7c
BLAKE2b-256 9805a660baad71507c0c1c45261179afe9d02199d6c9862e90df5e2283476e3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: robasedev-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for robasedev-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c223ab05fdc58c96c72dcde7b9e430eb3fa8f50208a80e1b6c3a6df9b94f5581
MD5 0e0ca63a62a0086c2978fd4885572547
BLAKE2b-256 0def967622a294a2f7fdd2ea8d8215a2e54eab9cbed8e90adf70195b5bab07d6

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