Skip to main content

qubrixa-mail

Official Python client for the Qubrixa Mail Developer API: create disposable inboxes, read messages, and extract OTP codes / verification links.

You need two things from your Qubrixa Mail account: the base URL and an API key (generate one in the Developer Console).

Install

pip install qubrixa-mail            # sync client (requests)
pip install "qubrixa-mail[async]"   # + async client (httpx)

Quick start

from qubrixa_mail import QubrixaMail

mail = QubrixaMail(
    base_url="https://mail.qubrixa.in/api/v1",   # your base URL
    api_key="sk_live_your_secret_api_key_here",  # your API key
)

inbox = mail.create_inbox(expires_in_seconds=3600)
print(inbox.address)                 # use this address on the site you are testing

otp = inbox.wait_for_otp(timeout=30)  # long-polls until the email arrives
print(otp.otp, otp.verification_url)

inbox.delete()

Or configure through environment variables and write QubrixaMail():

export QUBRIXA_BASE_URL="https://mail.qubrixa.in/api/v1"
export QUBRIXA_API_KEY="sk_live_..."

If you pass only a host (https://mail.qubrixa.in), /api/v1 is appended automatically.

Auto-cleanup

with QubrixaMail() as mail:
    with mail.temporary_inbox(expires_in_seconds=600) as inbox:
        ...  # inbox is deleted when the block exits

Async

import asyncio
from qubrixa_mail import AsyncQubrixaMail

async def main():
    async with AsyncQubrixaMail() as mail:
        async with mail.temporary_inbox() as inbox:
            otp = await mail.wait_for_otp(inbox, timeout=30)
            print(otp.otp)

asyncio.run(main())

API

Method Endpoint
create_inbox(expires_in_seconds=, local_part=, webhook_url=, **extra) POST /inboxes
delete_inbox(inbox) DELETE /inboxes/{id}
list_messages(inbox, limit=) GET /inboxes/{id}/messages
get_message(inbox, message_id) GET /inboxes/{id}/messages/{message_id}
wait_for_otp(inbox, timeout=30) GET /inboxes/{id_or_address}/wait-otp
latest_otp(inbox) GET /inboxes/{id_or_address}/latest-otp
get_quota() GET /quota
wait_for_message(inbox, timeout=, interval=, predicate=) polls list_messages (non-OTP mail)

inbox can be an Inbox object, an inbox id, or (for the OTP endpoints) an email address. Every returned object keeps the full server response in .raw.

Rate limits & bans

The server allows 300 requests/min and 10 inbox creations/min, and suspends a key + IP after 5 consecutive 429s within 5 minutes. This client protects you:

  • a built-in sliding-window limiter (default 270/min and 9/min) delays calls instead of failing;
  • 429 is never retried automatically - RateLimitError.retry_after tells you how long to wait;
  • after 3 consecutive 429s it raises AbuseGuardError locally without contacting the server;
  • only GET/DELETE are retried on connection errors and 502/503/504 (never POST).

Disable the limiter with QubrixaMail(..., rate_limit=False).

Errors

QubrixaError -> ConfigurationError, APIConnectionError, AbuseGuardError, OTPTimeoutError, and APIError -> AuthenticationError (401), ForbiddenError (403), NotFoundError (404), RateLimitError (429), ServiceUnavailableError (503).

CLI

qubrixa-mail create --expires-in 3600 --address-only
qubrixa-mail wait-otp test7391@samirjs.qzz.io --timeout 30 --otp-only
qubrixa-mail quota

Responsible use

Use disposable inboxes only for services and accounts you are allowed to test, and follow the terms of Qubrixa Mail and of every site you interact with. This is the official Python client for Qubrixa Mail.

Publish to PyPI

pip install build twine
python -m build
twine upload dist/*

Author / maintainer: Its2Pawan.

Metadata

Release files for qubrixa-mail 1.1.2

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

Source distribution (sdist)

Source distribution for qubrixa-mail 1.1.2
File Size Uploaded Provenance Actions
qubrixa_mail-1.1.2.tar.gz 17.8 kB Without provenance Details for qubrixa_mail-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qubrixa-mail 1.1.2
File Interpreter ABI Platform Actions
qubrixa_mail-1.1.2-py3-none-any.whl Python 3 none any Details for qubrixa_mail-1.1.2-py3-none-any.whl

Total release size: 36.2 kB

Release files / qubrixa_mail-1.1.2.tar.gz

Download URL qubrixa_mail-1.1.2.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
daed819b8bac1645b8953652143adad12301b978c58db30a076220e33e5be44e
BLAKE2b-256 checksum
How to use checksums
7bb567c3086da86484281859ff8f8290f4521f1323c2128a91a9c1f3c1e001b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / qubrixa_mail-1.1.2-py3-none-any.whl

Download URL qubrixa_mail-1.1.2-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fb697426b05527f656dbc125ea8e5bacf55e9885ee70cc8b07ed226b73a29ce
BLAKE2b-256 checksum
How to use checksums
30162ac8347a930e683e393b150e108b32550810e640df2f969546f17e954e1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for qubrixa-mail 1.1.2

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.1.2 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