Registry / testing / mailosaur

mailosaur

JSON →
library8.1.1pypypi✓ verified 84d ago

Mailosaur Python library for integrating email and SMS testing into CI/CD pipelines. Current version 8.1.1, supports Python >=2.7 (excluding 3.0-3.3). Released regularly with breaking changes in major versions.

pip install mailosaur
INSTALL
IMPORT
SIG · MAILOSAUR
M
mailosaur
testingpythonv8.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MailosaurClient
from mailosaur import MailosaurClient
import mailosaur
Importing the module directly does not expose MailosaurClient; must import the class explicitly.

Initialize Mailosaur client and generate a test email address using environment variables for credentials.

import os from mailosaur import MailosaurClient api_key = os.environ.get('MAILOSAUR_API_KEY', '') server_id = os.environ.get('MAILOSAUR_SERVER_ID', '') client = MailosaurClient(api_key) # Create a random email address email_address = client.servers.generate_email_address(server_id) print(f"Email address: {email_address}")
Debug
Known issues
breakingConstructor changed from MailosaurClient(api_key, base_url) to MailosaurClient(api_key) in v7. Base URL no longer a parameter.
fix
Remove the second argument from constructor. If custom base URL needed, set environment variable MAILOSAUR_BASE_URL.
affects: >=7.0.0
deprecatedMethod `client.servers.generate_email_address(server_id)` deprecated in v8, use `client.servers.emails.generate_email_address(server_id)`.
fix
Use `client.servers.emails.generate_email_address(server_id)` instead.
affects: >=8.0.0
gotchaThe library requires Python 2.7 or >=3.4; if using Python 3, ensure it's 3.4+ as 3.0-3.3 are not supported.
fix
Verify Python version: python --version. Upgrade to 3.4+ or 2.7.
affects: all
gotchaAPI key must be passed as a string; passing non-string (e.g., bytes) causes TypeError in Python 3.
fix
Ensure api_key is a string: `MailosaurClient(str(api_key))`.
affects: all
Errors
Common errors & fixes
AttributeError: 'MailosaurClient' object has no attribute 'servers'
Using an older version of the library where the API structure was different, or incorrect import.
fix
Upgrade to latest version: `pip install --upgrade mailosaur`. Ensure correct import: `from mailosaur import MailosaurClient` and instantiate with api_key.
TypeError: __init__() takes 2 positional arguments but 3 were given
Passing a second argument (base_url) to MailosaurClient in v7+.
fix
Remove the base_url argument: `client = MailosaurClient(api_key)`.
mailosaur.errors.MailosaurError: Unauthorized
Invalid or missing API key.
fix
Check MAILOSAUR_API_KEY environment variable or pass correct key. Ensure key is a string.
ImportError: No module named mailosaur
Library not installed or installed in wrong environment.
fix
Run `pip install mailosaur`. If using virtualenv, activate it first.
Upgrade
Version history
8.1.1latest on PyPI · released May 27, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
mailosaur — pip install mailosaur · libregistry