# sotempmail
A simple Python async wrapper for the [tempmail.so](https://rapidapi.com/tempmailso-tempmailso-default/api/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](https://docs.aiohttp.org/) (installed automatically)
## Installation
Install from PyPI:
```bash
pip install sotempmail
```
Or with Poetry:
```bash
poetry add sotempmail
```
Or with Pipenv:
```bash
pipenv install sotempmail
```
## Usage
You need a RapidAPI key and a Bearer token from tempmail.so. See [tempmail.so docs](https://rapidapi.com/tempmailso-tempmailso-default/api/tempmail-so) for details.
```python
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
- [PyPI](https://pypi.org/project/sotempmail/)
- [GitHub](https://github.com/jbsanf/sotempmail)
## License
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/jbsanf/sotempmail",
"name": "sotempmail",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Jo\u00e3o B. Santos",
"author_email": "joaobatista.sf@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/04/be/c2ca96539f11e4d37da6cdc11b25da49220b9998467bef811b5ab0ebfff1/sotempmail-0.1.3.tar.gz",
"platform": null,
"description": "# sotempmail\n\nA simple Python async wrapper for the [tempmail.so](https://rapidapi.com/tempmailso-tempmailso-default/api/tempmail-so) API.\n\n## Features\n- Create and delete temporary inboxes\n- List available domains\n- List inboxes and emails\n- Retrieve and delete emails\n\n## Requirements\n- Python 3.9+\n- [aiohttp](https://docs.aiohttp.org/) (installed automatically)\n\n## Installation\n\nInstall from PyPI:\n\n```bash\npip install sotempmail\n```\n\nOr with Poetry:\n\n```bash\npoetry add sotempmail\n```\n\nOr with Pipenv:\n\n```bash\npipenv install sotempmail\n```\n\n## Usage\n\nYou need a RapidAPI key and a Bearer token from tempmail.so. See [tempmail.so docs](https://rapidapi.com/tempmailso-tempmailso-default/api/tempmail-so) for details.\n\n```python\nimport asyncio\nfrom sotempmail import TempMailSo\n\nasync def main():\n api_key = \"<YOUR_RAPIDAPI_KEY>\"\n bearer = \"<YOUR_BEARER_TOKEN>\"\n tm = TempMailSo(api_key, bearer)\n\n # List available domains\n domains = await tm.list_domains()\n print(\"Domains:\", domains)\n\n # Create an inbox\n inbox_id = await tm.create_inbox(name=\"myinbox\", domain=domains[0].get(\"domain\"), lifespan=60)\n print(\"Created inbox:\", inbox_id)\n\n # List inboxes\n inboxes = await tm.list_inboxes()\n print(\"Inboxes:\", inboxes)\n\n # List emails in inbox\n emails = await tm.list_emails(inbox_id)\n print(\"Emails:\", emails)\n\n # If emails exist, retrieve the first one\n if emails:\n email_id = emails[0][\"_id\"]\n email = await tm.retrieve_email(inbox_id, email_id)\n print(\"Email:\", email)\n\n # Delete the email\n await tm.delete_email(inbox_id, email_id)\n print(\"Email deleted.\")\n\n # Delete the inbox\n await tm.delete_inbox(inbox_id)\n print(\"Inbox deleted.\")\n\nasyncio.run(main())\n```\n\n## Links\n- [PyPI](https://pypi.org/project/sotempmail/)\n- [GitHub](https://github.com/jbsanf/sotempmail)\n\n## License\nMIT\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple wrapper for tempmail.so api.",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/jbsanf/sotempmail"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3c572e4ea889358615ad81483f055900434feded4f6a7561bb646af9586705ab",
"md5": "28d4a255ee35483a06db1d85ae402c39",
"sha256": "e29de8659499458d3d5c6fe19b5e4f7bc770bd03c1be65f3753d2a1935ce481a"
},
"downloads": -1,
"filename": "sotempmail-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "28d4a255ee35483a06db1d85ae402c39",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 3480,
"upload_time": "2025-07-11T17:14:42",
"upload_time_iso_8601": "2025-07-11T17:14:42.383774Z",
"url": "https://files.pythonhosted.org/packages/3c/57/2e4ea889358615ad81483f055900434feded4f6a7561bb646af9586705ab/sotempmail-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "04bec2ca96539f11e4d37da6cdc11b25da49220b9998467bef811b5ab0ebfff1",
"md5": "37c6a536da399b643f838b4d8c3727d1",
"sha256": "1f809f6ea9d6b162aee54c6e1ff74e7122d7165eabfef7c80d91c3686d679865"
},
"downloads": -1,
"filename": "sotempmail-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "37c6a536da399b643f838b4d8c3727d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 2816,
"upload_time": "2025-07-11T17:14:43",
"upload_time_iso_8601": "2025-07-11T17:14:43.884955Z",
"url": "https://files.pythonhosted.org/packages/04/be/c2ca96539f11e4d37da6cdc11b25da49220b9998467bef811b5ab0ebfff1/sotempmail-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-11 17:14:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jbsanf",
"github_project": "sotempmail",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "sotempmail"
}