Validate Your Email
Project description
Robust Email Validator
RobustEmailValidator is a flexible and powerful Python library for validating email addresses. It verifies email syntax, checks for disposable domains, and validates domain MX records to ensure email deliverability.
Features
- Email Syntax Validation: Checks if an email address follows proper syntax.
- Bulk Email Validation: Validate multiple emails at once.
- Disposable Email Detection: Identifies if an email address belongs to a disposable service.
- MX Record Verification: Checks if the email domain has valid MX (Mail Exchange) records.
Installation
Prerequisites
Ensure you have the following installed:
- Python 3.7 or higher
pipfor dependency management
Installing via pip
-
Clone this repository to your local machine:
git clone https://github.com/tinapyp/robust-email-validator.git cd robust-email-validator
-
Install the library and its dependencies:
pip install .
Alternatively, once published on PyPI:
pip install robust-email-validator
Usage
The library is easy to integrate into any Python project.
Validating a Single Email
from robust_email_validator import validated_email
email = "test@example.com"
result = validated_email(email)
print(f"Is {email} valid? {result.is_valid}")
Checking if Email Domain is Disposable
from robust_email_validator import check_email_disposable
email = "test@tempmail.com"
result = check_email_disposable(email)
print(f"Is {email} disposable? {'Yes' if not result.is_valid else 'No'}")
Checking if Email Domain Has MX Records
from robust_email_validator import check_email_mx
email = "test@example.com"
result = check_email_mx(email)
print(f"Does {email} have MX records? {'Yes' if result.is_valid else 'No'}")
Configuration
The library allows configuration of the disposable domain list source. In config.py, set the URL to fetch a disposable domain list as needed:
# config.py
DISPOSABLE_URL = "https://someapi.com/disposable-domains"
Development
To contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-branch. - Implement your changes and write tests.
- Run tests to ensure functionality:
pytest. - Submit a pull request with a summary of your changes.
Running Tests
To run tests, install pytest if needed:
pip install pytest
Then run:
pytest test/test_email_validator.py
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgements
Contributions and feedback are welcome! Open an issue or submit a pull request if you’d like to get involved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robust_email_validator-0.1.0.tar.gz.
File metadata
- Download URL: robust_email_validator-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a31263798b60be2a0530b4332193e29dfc526383380f820dd1c587c263f8d304
|
|
| MD5 |
25fdc65438c48486356ea4db6ced1fb9
|
|
| BLAKE2b-256 |
d286388ebb4560a8311bb65cb7625c2d95c9e7535fe27fc9d3116c8a16910b8c
|
File details
Details for the file robust_email_validator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: robust_email_validator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c62baf9a5127781a8c5e0a759c1370519a0dbb5028fd4a15bc4f04d790f6a9b
|
|
| MD5 |
32f031f297c9a2794b479969180189b4
|
|
| BLAKE2b-256 |
897337f9b51f0b2bfb880df12f10e2ffd564f11dbd0a88d94abc72929547af32
|