Skip to main content

Official Python SDK for the Sendrella API – email validation, bounce checking, and disposable detection.

Project description

Sendrella Python SDK

The official Python SDK for Sendrella — a modern infrastructure for secure and intelligent email communication.

It enables effortless integration with the Sendrella API to perform:

  • ✉️ Email bounce checks
  • 🛡️ Disposable (temporary) email detection
  • 📊 Credit tracking
  • 🔐 API key validation

📦 Installation

Install directly via Git:

pip install git+https://github.com/Salman0x01/sendrella-python-sdk.git

Or clone this repo and install locally:

git clone https://github.com/Salman0x01/sendrella-python-sdk.git
cd sendrella-python-sdk
pip install .

🔑 Authentication

Every API call requires a valid Sendrella API key.

🔐 Get your key:

  1. Log in to Sendrella Dashboard
  2. Copy your API key
  3. Use it in the SDK like this:
from sendrella import SendrellaClient

client = SendrellaClient(api_key="your_api_key_here")

🚀 Usage Examples

📬 Check Email Bounce

result = client.bounce.check("hello@example.com")
print(result["status"])          # valid / warn / risky / invalid / error
print(result["bounce_score"])    # Score between 0–100
print(result["confidence_indicators"])

📑 Retrieve Bounce Logs

logs = client.bounce.logs(page=1, status="risky")
for log in logs["logs"]:
    print(log["email"], "-", log["status"], "(", log["bounce_score"], ")")

🛡️ Check Disposable Email

result = client.temp_mail.check("user@mailinator.com")
if result.get("is_disposable"):
    print("❌ Disposable email detected")
else:
    print("✅ Clean email")

📂 View Temp Mail Logs

logs = client.temp_mail.logs(page=1)
for log in logs["logs"]:
    print(log["email"], "-", log["status"], "via", log["detection_method"])

💳 Fetch Credits

credits = client.utils.credits()
print("Available:", credits["available_credits"])
print("Used:", credits["all_time_used"])
print("Total:", credits["all_time_credits"])

🔐 Validate API Key

info = client.utils.validate_key()
if info.get("success"):
    print("Authenticated as:", info.get("name"))
else:
    print("Invalid or expired API key")

🧪 Running Tests

# Run all tests
pytest -v tests/

# Or run one
pytest -v tests/test_bounce.py

Make sure to set your API key:

set SENDRELLA_API_KEY=your_api_key_here   # Windows
export SENDRELLA_API_KEY=your_api_key_here  # Linux/macOS

📚 Supported Endpoints

Feature Method Path
Bounce Check client.bounce.check() /bounce/check
Bounce Logs client.bounce.logs() /bounce/logs
Disposable Check client.temp_mail.check() /tempmail/check
Temp Logs client.temp_mail.logs() /tempmail/logs
Get Credits client.utils.credits() /utils/credits
Validate API Key client.utils.validate_key() /token/validate

🛠️ Error Handling

All errors are wrapped in custom exceptions:

  • SendrellaError (base)
  • AuthenticationError
  • BadRequestError
  • ServerError
  • TimeoutError
  • NotFoundError

Example:

from sendrella.exceptions import AuthenticationError

try:
    result = client.bounce.check("email@example.com")
except AuthenticationError:
    print("Invalid API key or permission denied.")

📄 License

MIT License © 2025 [Your Name or Company]


❤️ Contributing

PRs welcome! Please submit bug fixes, improvements, or new endpoints with test coverage.


🔗 Useful Links

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

sendrella-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

sendrella-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sendrella-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.5 Windows/11

File hashes

Hashes for sendrella-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f3e1e57506a034916c5b4bad91bffb9d83907500217908d3ea1cc85b5fcec45
MD5 451f5ae963713b83263e1615545e606c
BLAKE2b-256 ebc6f6e658dbce9ef4a4f14b258f0338baa38a2f5473cbaec32acf7c4a7d1ca6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sendrella-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.5 Windows/11

File hashes

Hashes for sendrella-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 958f8cbe06422e2f674da311e2303e1dacd336a962a750376e73b4f786b324ca
MD5 9aaae1e7a3d19b8d6984eb455e0258b9
BLAKE2b-256 017486b23529a7732a5fcd11739c0bc9f6d06a5a710f66f1bcd4aa56ca64555d

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