Metadata-Version: 2.4
Name: dnse-emailotp
Version: 0.1.0
Summary: Gmail OTP retrieval via IMAP IDLE for DNSE
Project-URL: Homepage, https://github.com/dnse-tech/dnse-emailotp
Project-URL: Repository, https://github.com/dnse-tech/dnse-emailotp
Project-URL: Issues, https://github.com/dnse-tech/dnse-emailotp/issues
Author-email: DNSE <tech@dnse.com.vn>
License-Expression: PolyForm-Noncommercial-1.0.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Email
Requires-Python: >=3.10
Requires-Dist: imapclient>=2.3
Provides-Extra: dnse
Requires-Dist: dnse; extra == 'dnse'
Description-Content-Type: text/markdown

# dnse-emailotp

Gmail OTP retrieval via IMAP IDLE for DNSE.

## Install

```bash
pip install dnse-emailotp
```

## Quick Start

```python
from dnse_email_otp import ImapListener, extract_otp

with ImapListener("you@gmail.com", "app-password") as listener:
    msg = listener.wait_for_new_message(timeout=60)
    if msg:
        otp = extract_otp(msg.body_text)
        print(otp)  # "510345"
```

Or use the convenience helper:

```python
from dnse_email_otp import wait_for_otp

otp = wait_for_otp("you@gmail.com", "app-password", timeout=60)
print(otp)  # "510345"
```

## Requirements

- Python >= 3.10
- Gmail account with [App Password](https://support.google.com/accounts/answer/185833) (required when 2FA is enabled)

## License

Licensed under [PolyForm Noncommercial 1.0.0](LICENSE).

Free for personal and noncommercial use. For commercial licensing, contact [DNSE](https://dnse.com.vn).
