Skip to main content

Orevail Python SDK

The official, zero-dependency Python library for interacting with the Orevail Developer Mail Network.

Orevail is a developer-first transactional and temporary email network. By designing routes on high-reputation domains and validating them with 2048-bit DKIM keys, Orevail allows you to test inbound mail parsing loops, run transactional flows, and mock sandbox accounts easily without getting flagged by spam-reputation checkers.


Key Features

  • Zero Dependencies: Built entirely on top of Python's standard urllib module. No need to install requests or other third-party dependencies.
  • Type-Hinted: Fully typed for modern Python editors (VS Code, PyCharm).
  • Resilient: Clean mapping of API error payloads to custom, descriptive exceptions (OrevailAuthError, OrevailAPIError).
  • Compatible: Tested and supported across all active Python versions (>= 3.7).

Installation

Install the package via pip:

pip install orevail

Quickstart Guide

1. Instant Mailbox Allocation

Create a virtual sandbox address on-the-fly. The API key is returned exactly once in this payload.

from orevail import Orevail

# Create a virtual user mailbox dynamically
reg_info = Orevail.create_user("test-runner@orevail.com")

print(f"Allocated Email: {reg_info['email']}")
print(f"Sandbox API Key: {reg_info['api_key']}")

2. Initializing the Authenticated Client

Once you have your sandbox API key, initialize the authenticated client:

from orevail import Orevail

client = Orevail(api_key="your_orevail_api_key_here")

3. Send Outbound Transactional Emails

Enqueue emails into Orevail's outbox. Outbound emails are cryptographically signed with DKIM on-the-fly and routed instantly.

# Send a transactional email
receipt = client.send_email(
    sender="test-runner@orevail.com",
    recipient="customer@example.com",
    subject="Your Verification Token",
    text="Your security token is: 884712",
    html="<p>Your security token is: <strong>884712</strong></p>"
)

print(f"Outbox Job Queued. Job ID: {receipt['jobId']}")

4. Fetch and Parse Inbox Mails

Check the sandbox mailbox to parse incoming emails (e.g. testing outbound alerts, registration loops, or parse triggers).

# Poll the incoming mail stream
inbox = client.get_emails("test-runner@orevail.com", direction="incoming", limit=10)

print(f"Retrieved {inbox['count']} messages:")
for mail in inbox["emails"]:
    print("-" * 40)
    print(f"From: {mail['sender']}")
    print(f"Subject: {mail['subject']}")
    print(f"Body: {mail['body_text']}")
    
    # Check for attachments
    if mail.get("attachments"):
        print(f"Attachments: {[att['filename'] for att in mail['attachments']]}")

5. Download Email Attachments

Fetch raw binary content files associated with an incoming email:

# If an attachment exists, download its raw content
attachment_bytes = client.download_attachment(attachment_id=12)

with open("downloaded_invoice.pdf", "wb") as f:
    f.write(attachment_bytes)

Exception Handling

Orevail wraps exceptions cleanly to help you debug quickly:

from orevail import Orevail, OrevailAuthError, OrevailAPIError, OrevailError

try:
    client = Orevail(api_key="invalid_key")
    client.get_emails("test-runner@orevail.com")
except OrevailAuthError as e:
    print(f"Credentials Rejected: {e}")
except OrevailAPIError as e:
    print(f"API Error [{e.status_code}]: {e}")
except OrevailError as e:
    print(f"General SDK failure: {e}")

License

MIT License. Created by the Orevail Core Team.

Metadata

Release files for orevail 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orevail 1.0.0
File Size Uploaded Provenance Actions
orevail-1.0.0.tar.gz 5.6 kB Without provenance Details for orevail-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orevail 1.0.0
File Interpreter ABI Platform Actions
orevail-1.0.0-py3-none-any.whl Python 3 none any Details for orevail-1.0.0-py3-none-any.whl

Total release size: 11.4 kB

Release files / orevail-1.0.0.tar.gz

Download URL orevail-1.0.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2d97f68a452e4c8f6eed6a57bae4a911ef8af11ab865b9fa96b1a08d484ef5e8
BLAKE2b-256 checksum
How to use checksums
56e269f9bf5766715e6d5fde3be3c3cc0478ec05341e65914babd0fcb5772ebe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / orevail-1.0.0-py3-none-any.whl

Download URL orevail-1.0.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74d34734fc2a5d891bbbfb132ecb55a651b4ee91cc3387eccdc993a5d70efcea
BLAKE2b-256 checksum
How to use checksums
0da81670170377ad3ca617b644239929055fb2448e3cc07d21a8a9f8133785f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for orevail 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page