Skip to main content

Python library for temporary email addresses

Project description

PyTempBox - Python Temporary Email Service

PyPI version Python versions License: MIT

PyTempBox is a lightweight Python library for generating and managing temporary email addresses. Perfect for testing, automation, and protecting your privacy when interacting with online services.

✨ Features

With this service, you can instantly create temporary email addresses 🚀. Once the email address is generated, you can fetch incoming messages in real-time 📩. The service is designed to be lightweight ⚡, requiring minimal dependencies. Additionally, the API follows best practices in Python programming, making it user-friendly 🐍. Security is a top priority, as all connections are made through secure HTTPS 🔒. You can also retrieve the full content of each message received 📝.

📦 Installation

To install the package, simply run the following command in your terminal:

pip install pytempbox

Please note that this package requires Python version 3.9 or higher to work properly.

🚀 Quick Start

"""
🔥 PyTempBox Quickstart: Temporary Emails in 3 Steps 🔥

1. Create → 2. Receive → 3. Read
"""

from pytempbox import PyTempBox

# 1️⃣ CREATE - Instant email generator
temp_mail = PyTempBox()
email_address = temp_mail.generate_email()
print(f"📧 Your shiny new temp email: {email_address}")

# 2️⃣ RECEIVE - Smart email checker (auto-retries)
print("\n🕵️ Checking inbox...")
inbox = temp_mail.get_messages(email_address)

if not inbox:
    print("✨ Inbox is empty (try sending a test email first!)")
else:
    # 3️⃣ READ - Clean message display
    print(f"\n📬 Found {len(inbox)} message(s):")
    
    for i, message in enumerate(inbox, 1):
        print(f"\n━━━━ Message #{i} ━━━━")
        print(f"From: {message['from']}")
        print(f"Subject: {message['subject']}")
        print(f"\n{message['body_text'][:200]}...")  # Preview first 200 chars
        print("━━━━━━━━━━━━━━━━━━━━")

📚 Documentation

Core Methods

The package offers several useful functions to manage temporary emails. First, you can use generate_email(min_length=10, max_length=15) to create a new temporary email address with a specified minimum and maximum length 🆕✉️. To retrieve messages sent to that email, you can call get_messages(email, timeout=300, interval=10), which checks for incoming messages within a set timeout and interval ⏳📥. If you want to see the full content of a specific message, you can use get_message_content(email, message_id) to get all the details of that message 📜. Lastly, the function get_available_domains() will list all the email domains you can use for generating temporary addresses 🌐.

Advanced Usage

# Customize email generation
email = client.generate_email(min_length=8, max_length=12)

# Get specific message details
message = client.get_message_content(
    email="your_temp@example.com",
    message_id="12345"
)

📜 License

This package is distributed under the MIT License, which means you can use, modify, and distribute it freely. For more details about the license, please refer to the LICENSE file. 📄✨

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

pytempbox-0.1.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

pytempbox-0.1.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pytempbox-0.1.2.tar.gz.

File metadata

  • Download URL: pytempbox-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pytempbox-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fe155abb3fb5c61950f497a96993f586dbffc9cd750738714aaefddeac38a2a0
MD5 5eba7906e1894ae0ec8f421552bb0236
BLAKE2b-256 9da839a737731251887e05007777abc3f34d7c51b00373c893a2c3ca6351e07e

See more details on using hashes here.

File details

Details for the file pytempbox-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pytempbox-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pytempbox-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1a9d91354c425d16a5557f5bdf6d74a5334aec2c50918c60e114337b1c7f996e
MD5 09c26579eff8d7ce4b7f419a1f202241
BLAKE2b-256 3ed0d91804568b1e5cb199fe1507879bbc329c59bf4fa762d4974f2c8910593b

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