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.

Effortlessly integrate the Sendrella API into your Python apps for:

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

📦 Installation

🔗 Install via PyPI (recommended):

pip install sendrella

🧪 Development (local or GitHub):

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

Or clone and install locally:

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

🚀 Quick Start

from sendrella import SendrellaClient

client = SendrellaClient(api_key="your_api_key_here")

result = client.bounce.check("hello@example.com")
print(result["status"])

🔑 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 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 Salman Khan


❤️ 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.1.tar.gz (7.8 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.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sendrella-0.1.1.tar.gz
  • Upload date:
  • Size: 7.8 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.1.tar.gz
Algorithm Hash digest
SHA256 daf85ff43507a7f1eb427156a6ef63255ac62e9a83d8796cf3dc4063e32d033f
MD5 7025f831ef3fa57ee2f611ce06725578
BLAKE2b-256 029e600db1dcb688ab18911849536dd1e81134b4f0f3a17ca61ede907da5c08d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sendrella-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d4ba30151634eccd3955341045369bbe82050a165c33a3405f6068c0a8d508c
MD5 2528e15b762b0a16743af57b2804171a
BLAKE2b-256 10a6ff2c0f1cca95dee0ef844a01e3f196c892cc10df9d6e7f504bf7a93bd837

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