Skip to main content

Asynchronous Python library for working with temporary email services

Project description

async-temp-email

PyPI version Python Version

Overview

async-temp-email is an asynchronous Python library for working with temporary email services. It allows you to easily generate disposable email addresses, fetch messages, and poll for incoming emails in real-time.

This library supports a modular design, enabling integration with multiple temporary email providers. Currently supported provider:

  • Emailnator

Features

  • Asynchronous API for generating temporary email addresses
  • Fetch messages for a given mailbox
  • Retrieve individual message content
  • Real-time polling of incoming emails
  • Easy integration with multiple providers via a registry-based client system

Installation

pip install async-temp-email

Usage

Create a client

from async_temp_email import TempEmailClient

# Initialize a provider client
client = TempEmailClient.create("emailnator", timeout=30, retries=3)

async with TempEmailClient.create("emailnator", timeout=30, retries=3) as client: # Recommended
    ...

Generate a temporary email

from pydantic import EmailStr

email: EmailStr = await client.service.get_email()
print(email)

Fetch messages

messages = await client.service.get_messages(email)
for msg in messages:
    print(msg.message_subject, msg.message_content)

Poll for new messages

async with client.polling(email=email, poll_interval=5, skip_existing=False) as poller:
    async for message in poller:
        print(message.message_subject, message.message_content)

License

Code and documentation copyright 2025-2026. Code released under the MIT License.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to fork the repository and submit a pull request.

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

async_temp_email-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

async_temp_email-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: async_temp_email-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for async_temp_email-0.1.0.tar.gz
Algorithm Hash digest
SHA256 72e0ef9ee325bc71c42ee470ed12b7793de7d14815d4cffe61e88f08b97f753f
MD5 598197f694b11dde1f6379761bcc86e1
BLAKE2b-256 3e960b45d285e940b072d4ea7fdf86ca621023f3777437c40c9f05be9eeca226

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for async_temp_email-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11a8643cc0678dcb31d66a6ee16f5d32e6985a19f3e9264f1a5e75c67f432a06
MD5 31e4c2dc53c2d25da09672b096c58498
BLAKE2b-256 7fbab62b0a205f64e8836ad3c70409c68c6f33d8cf5001df1cbf89bd5d92cac1

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