Tigrmail SDK
Tigrmail SDK is a Python library for automating email verification workflows. It allows you to generate temporary inboxes and poll for email messages with customizable filters. This library is ideal for testing email-based features or automating email verification processes.
If you are working in a different programming language, you can still access all features by integrating directly with our API.
Features
- Generate temporary inboxes.
- List available inbox domains and create inboxes on a selected domain.
- Poll for the next email message with advanced filtering options (e.g., by subject, sender email, or domain).
- Built-in error handling for API interactions.
- Automatic retry logic for HTTP requests.
Installation
pip install tigrmail
Usage
Importing the Library
from tigrmail import Tigrmail, TigrmailError
Creating an Instance
To use the library, retrieve your API token from our console and create a Tigrmail instance using that token:
tigrmail = Tigrmail(token="your-api-token")
Generating a Temporary Inbox
email_address = tigrmail.create_email_address()
print(email_address) # <random-email-address>@<domain>
Selecting a Domain
domains = tigrmail.get_domains()
print(domains) # ["den.tigrmail.com"]
email_address = tigrmail.create_email_address(domain=domains[0])
print(email_address)
Polling for the Next Email Message
You can poll for the next email message using filters:
message = tigrmail.poll_next_message(
inbox=email_address,
subject={"contains": "Verification"},
from_={"email": "noreply@example.com"},
)
print(f"Received email: {message['subject']}")
Playwright Integration Example
For a complete example of using Tigrmail SDK with Playwright for automated email verification testing, check out our Playwright Email Verification Example.
Context Manager Usage
The library supports Python's context manager protocol for automatic resource cleanup:
from tigrmail import Tigrmail, TigrmailError
try:
with Tigrmail(token="your-api-token") as tigrmail:
inbox = tigrmail.create_email_address()
message = tigrmail.poll_next_message(
inbox=inbox,
subject={"contains": "Verification"},
from_={"email": "noreply@example.com"},
)
print(message["subject"])
except TigrmailError as error:
print(f"Error: {error.general_message}")
API Reference
Tigrmail.get_domains() -> List[str]
Returns the available inbox domains.
Tigrmail.create_email_address(domain=None) -> str
Generates a temporary email address. Pass domain to create the address on a specific available domain.
Tigrmail.poll_next_message(inbox, subject=None, from_=None) -> dict
Polls for the next email message with optional filters:
inbox(str): The email address to poll for messagessubject(dict, optional): Filter by subject line{"contains": str}- Subject contains the specified string{"equals": str}- Subject exactly matches the specified string
from_(dict, optional): Filter by sender{"email": str}- From a specific email address{"domain": str}- From any address at the specified domain
Returns an EmailMessage dictionary with message details.
Error Handling
The library raises TigrmailError for API-related issues. You can catch and handle these errors as follows:
try:
inbox = tigrmail.create_email_address()
except TigrmailError as error:
print(f"Error: {error.general_message}")
except Exception as error:
print(f"Unexpected error: {error}")
Technical Details
- Base URL:
https://api.tigrmail.com - Timeout: 180s
- Retries: 3 (exponential backoff) on all HTTP/transport errors
- Uses
httpxunder the hood with simple retry logic
License
This project is licensed under the MIT License.
Metadata
Release files for tigrmail 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tigrmail-0.5.0.tar.gz | 45.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tigrmail-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.2 kB
Release files / tigrmail-0.5.0.tar.gz
| Download URL | tigrmail-0.5.0.tar.gz |
|---|---|
| Size | 45.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3c0bb841990ec49ecdd9905c67d12b7ea0035ec91527fe13a83976b364eceb2
|
|
BLAKE2b-256 checksum How to use checksums |
c60a98a1583d93d079e44e2abf72bf70a93370fb3a8c0b81ace7744ab53d6cac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / tigrmail-0.5.0-py3-none-any.whl
| Download URL | tigrmail-0.5.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2ad942b3a8cfd3e9de5595a419ede88e58d3572b3c55047ad0b9701d5b0e14f
|
|
BLAKE2b-256 checksum How to use checksums |
e06df0e9c57c1afb469b42d31001f689dd16b97b9fafc6a381d993d7d4f96482
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|