Metadata-Version: 2.4
Name: mailsentry
Version: 1.0.0
Summary: Official Python SDK for the MailSentry email validation API
Author-email: MailSentry <hello@mailsentry.dev>
License: MIT
Project-URL: Homepage, https://mailsentry.dev
Project-URL: Documentation, https://mailsentry.dev/docs
Project-URL: Repository, https://github.com/mailsentry/mailsentry-python
Keywords: email,validation,verification,mailsentry,disposable,smtp
Classifier: Development Status :: 5 - Production/Stable
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
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.20.0

# mailsentry

Official Python SDK for the [MailSentry](https://mailsentry.dev) email validation API.

## Installation

```bash
pip install mailsentry
```

## Quick Start

```python
from mailsentry import MailSentry

client = MailSentry(api_key="ms_live_your_key_here")

# Single verification
result = client.verify("user@example.com")
print(result["score"], result["verdict"])

# Bulk verification
bulk = client.bulk_verify([
    "user1@example.com",
    "user2@example.com",
    "user3@example.com",
])
print(f"Validated {bulk['total']} emails")

# Get job details
job = client.get_bulk_job(bulk["id"])

# List recent jobs
jobs = client.list_bulk_jobs()
```

## Configuration

```python
client = MailSentry(
    api_key="ms_live_your_key_here",  # Required
    base_url="https://mailsentry.dev",  # Optional (default)
    timeout=30,  # Optional: request timeout in seconds (default: 30)
)
```

## API Reference

### `verify(email) -> dict`

Validates a single email address. Returns score (0-100), verdict, and detailed checks across 8 validation layers.

### `bulk_verify(emails, filename=None) -> dict`

Validates multiple emails in one request. Batch size depends on your plan.

### `get_bulk_job(job_id) -> dict`

Retrieves the full results of a bulk validation job.

### `list_bulk_jobs() -> list`

Lists your 20 most recent bulk validation jobs.

## Error Handling

```python
from mailsentry import MailSentry, MailSentryError

try:
    result = client.verify("user@example.com")
except MailSentryError as e:
    print(f"API error {e.status}: {e}")
```

## Links

- [Documentation](https://mailsentry.dev/docs)
- [Sign up](https://mailsentry.dev/signup) — 1,000 free checks/month
```
