sotempmail
A simple Python async wrapper for the tempmail.so API.
Features
- Create and delete temporary inboxes
- List available domains
- List inboxes and emails
- Retrieve and delete emails
Requirements
- Python 3.9+
- aiohttp (installed automatically)
Installation
Install from PyPI:
pip install sotempmail
Or with Poetry:
poetry add sotempmail
Or with Pipenv:
pipenv install sotempmail
Usage
You need a RapidAPI key and a Bearer token from tempmail.so. See tempmail.so docs for details.
import asyncio
from sotempmail import TempMailSo
async def main():
api_key = "<YOUR_RAPIDAPI_KEY>"
bearer = "<YOUR_BEARER_TOKEN>"
tm = TempMailSo(api_key, bearer)
# List available domains
domains = await tm.list_domains()
print("Domains:", domains)
# Create an inbox
inbox_id = await tm.create_inbox(name="myinbox", domain=domains[0].get("domain"), lifespan=60)
print("Created inbox:", inbox_id)
# List inboxes
inboxes = await tm.list_inboxes()
print("Inboxes:", inboxes)
# List emails in inbox
emails = await tm.list_emails(inbox_id)
print("Emails:", emails)
# If emails exist, retrieve the first one
if emails:
email_id = emails[0]["_id"]
email = await tm.retrieve_email(inbox_id, email_id)
print("Email:", email)
# Delete the email
await tm.delete_email(inbox_id, email_id)
print("Email deleted.")
# Delete the inbox
await tm.delete_inbox(inbox_id)
print("Inbox deleted.")
asyncio.run(main())
Links
License
MIT
Metadata
Release files for sotempmail 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sotempmail-0.1.3.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sotempmail-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.3 kB
Release files / sotempmail-0.1.3.tar.gz
| Download URL | sotempmail-0.1.3.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f809f6ea9d6b162aee54c6e1ff74e7122d7165eabfef7c80d91c3686d679865
|
|
BLAKE2b-256 checksum How to use checksums |
04bec2ca96539f11e4d37da6cdc11b25da49220b9998467bef811b5ab0ebfff1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.4 Linux/6.15.3-200.fc42.x86_64
|
Release files / sotempmail-0.1.3-py3-none-any.whl
| Download URL | sotempmail-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e29de8659499458d3d5c6fe19b5e4f7bc770bd03c1be65f3753d2a1935ce481a
|
|
BLAKE2b-256 checksum How to use checksums |
3c572e4ea889358615ad81483f055900434feded4f6a7561bb646af9586705ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.4 Linux/6.15.3-200.fc42.x86_64
|