Metadata-Version: 2.5
Name: email-validation-sdk
Version: 1.0.0
Summary: Official Python client for the email-validation.org email validation API.
Project-URL: Homepage, https://email-validation.org/docs/sdks/python/
Project-URL: Documentation, https://email-validation.org/docs/
Author-email: "email-validation.org" <support@email-validation.org>
License-Expression: MIT
License-File: LICENSE
Keywords: api,email,email validation,email verification,sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications :: Email
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# email-validation.org Python SDK

Official Python client for the [email-validation.org](https://email-validation.org) API: validate single addresses,
read credits and usage, run bulk jobs and verify webhook signatures. Synchronous and asynchronous clients, typed
results (`TypedDict`) and typed errors. Python 3.10+.

```bash
pip install email-validation-sdk
```

```python
import os

from email_validation import EmailValidation

with EmailValidation(os.environ["EV_API_KEY"]) as ev:
    result = ev.validate("accepted@sandbox.email-validation.org")  # free test address
    print(result["status"], result["reason"], result["action"])
```

Async: `AsyncEmailValidation` has the same methods (`await ev.validate(...)`).

- **Results:** `status` is `valid`, `invalid`, `catch_all`, `unknown` or `disposable`; spam traps and frequent
  complainers are `valid` with the action `remove` (reason `spamtrap` / `complainer`). `unknown` results never cost a
  credit.
- **Retries:** `429` and `503` answers are retried with backoff, honouring `Retry-After` (`max_retries`,
  `max_retry_wait`). Validations are not retried after a network failure, because they may already have been charged.
- **Errors:** `EmailValidationError` and subclasses (`AuthenticationError`, `InsufficientCreditsError`,
  `RateLimitError`, …) with `status`, `code`, `request_id` and `retry_after`.
- **Bulk:** `ev.bulk.create(emails=[...])` or `ev.bulk.create(file=...)`, then `ev.bulk.wait(job_id)` and
  `ev.bulk.results(job_id, filter=["valid"])`.
- **Webhooks:** `verify_webhook(raw_body, headers, secret)` checks Standard Webhooks signatures.
- **EU data residency:** pass `base_url=EU_BASE_URL` to call `https://api-eu.email-validation.org`, where checks are validated
  and stored in the EU (https://email-validation.org/docs/eu-data-residency/).

Documentation: https://email-validation.org/docs/sdks/python/

## Tests

From the unpacked source distribution:

```bash
python3 -m unittest discover -s tests -t .   # stdlib only; httpx-specific tests are skipped without httpx
# or, with dev dependencies installed (pip install -e ".[test]"):
pytest
```
