Metadata-Version: 2.5
Name: temptf
Version: 0.1.0
Summary: Python client for the temp.tf disposable email API
Project-URL: Homepage, https://github.com/patrikdzejn88-ux/temptf
Project-URL: Repository, https://github.com/patrikdzejn88-ux/temptf
Project-URL: Issues, https://github.com/patrikdzejn88-ux/temptf/issues
Author: Liaksol
License-Expression: MIT
License-File: LICENSE
Keywords: api-client,disposable-email,inbox,temp-tf,tempmail
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Email
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.8
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Description-Content-Type: text/markdown

# temptf

Python client library for the [temp.tf](https://temp.tf/) disposable email API. Zero external dependencies.

## Installation

```bash
pip install git+https://github.com/patrikdzejn88-ux/temptf.git
```

Or install locally from source:

```bash
git clone https://github.com/patrikdzejn88-ux/temptf.git
cd temptf
pip install .
```

## Quick Start

### Creating Addresses by Provider

```python
import temptf

# Random address across all providers
email = temptf.create_email()

# Provider-specific addresses
gmail_any = temptf.create_gmail()          # @gmail.com (dot or plus)
gmail_dot = temptf.create_gmail_dot()      # u.s.e.r@gmail.com
gmail_plus = temptf.create_gmail_plus()    # user+tag@gmail.com
outlook = temptf.create_outlook()          # user+tag@outlook.com
hotmail = temptf.create_hotmail()          # user+tag@hotmail.com
edu = temptf.create_edu()                  # @high.edu.pl
```

### Reading and Streaming Messages

```python
import temptf

email = temptf.create_outlook()
print("Listening on:", email)

# Fetch current inbox contents once
messages = temptf.get_messages(email)

# Block until the first matching message arrives
msg = temptf.wait_for_message(email, timeout=60.0)
print(msg.subject, msg.text)

# Stream incoming messages continuously
for msg in temptf.stream_messages(email, interval=5.0):
    print(f"[{msg.date}] {msg.sender}: {msg.subject}")
    print(msg.text)
```

### Using `TempTFClient` Directly

```python
from temptf import TempTFClient

client = TempTFClient(timeout=10.0)
email = client.create_gmail_plus()

for msg in client.stream_messages(email):
    for att in msg.attachments:
        client.download_attachment(email, msg.id, att.id, dest=f"./downloads/{att.name}")
```

## License

MIT
