Skip to main content

Emailfy is a powerful Python package designed for comprehensive email address validation. It goes beyond basic syntax checks, providing advanced validation features and deliverability checks to ensure that email addresses are not only correctly formatted but also deliverable in a real-world environment.

Project description

Emailfy: Validation and Deliverability Checker

License

Emailfy is a Python package designed for comprehensive email address validation and checking the deliverability of email addresses. It goes beyond basic syntax checks, providing advanced validation features and deliverability checks to ensure that email addresses are not only correctly formatted but also deliverable in a real-world environment.

Features

Key Features:

  • Email Validation: Verify if an email address is syntactically correct and adheres to established RFC standards.
  • Internationalization Support: Support for internationalized email addresses, including UTF-8 and IDNA encoding.
  • Deliverability Checks: Ensure the deliverability of email addresses by validating MX records, SPF policies, and domain existence.
  • Customizable Options: Fine-tune validation with customizable settings, including allowing SMTPUTF8, quoted local parts, domain literals, and more.
  • Test Environment Support: Accommodate testing environments where special-use domain names are allowed.

Use Cases:

  • Web Forms: Enhance the user experience by ensuring that entered email addresses are both valid and deliverable.
  • Email Verification Services: Build robust email verification services by seamlessly integrating emailfy for thorough validation.
  • API Endpoints: Secure your applications by validating email addresses before processing user inputs.

Additional Features:

  • Custom Resolver: Configure custom DNS resolvers with adjustable timeouts for deliverability checks.
  • Special Use Domain Handling: Optionally exclude special-use domains from deliverability checks.

Ensure your application's email handling is reliable and secure with emailfy — the ultimate solution for email validation, deliverability checks, and customizable options.

Installation

You can install Emailfy using pip:

pip install emailfy

Usage

  • Basic Email Validation:
from emailfy import validate_email, EmailNotValidError

try:
    validated_email = validate_email("user@example.com")
    print("Email is valid:", validated_email.normalized)

except EmailNotValidError as e:
    print("Email is not valid:", str(e))
  • Custom Resolver Configuration:
from emailfy import caching_resolver, validate_email, EmailNotValidError

# Configure a custom resolver with a longer timeout
custom_resolver = caching_resolver(timeout=20)

try:
    validated_email = validate_email("user@example.com", dns_resolver=custom_resolver)
    print("Email is valid:", validated_email.normalized)

except EmailNotValidError as e:
    print("Email is not valid:", str(e))
  • Using Special Use Domain Names:
from emailfy import SPECIAL_USE_DOMAIN_NAMES, validate_email, EmailNotValidError

try:
    validated_email = validate_email("user@example.com", globally_deliverable=False)
    print("Email is valid:", validated_email.normalized)

except EmailNotValidError as e:
    print("Email is not valid:", str(e))

Configuration

Emailfy provides global attributes that you can adjust:

ALLOW_SMTPUTF8 ALLOW_QUOTED_LOCAL ALLOW_DOMAIN_LITERAL GLOBALLY_DELIVERABLE CHECK_DELIVERABILITY TEST_ENVIRONMENT DEFAULT_TIMEOUT

Refer to the documentation for detailed information on each configuration attribute.

Contributing

If you find a bug, have questions, or want to contribute, please check our contribution guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emailfy-0.1.5.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emailfy-0.1.5-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file emailfy-0.1.5.tar.gz.

File metadata

  • Download URL: emailfy-0.1.5.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for emailfy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 566729bd62cdeda7ea1a1452dda5a717a402798e69691525754f80f091b05edf
MD5 b777ff542254d963db90fb65f9e50ee4
BLAKE2b-256 8a2a047d4be551b272bbcd72d4267e2f6950b73a29d890684a2a78e66ed395cb

See more details on using hashes here.

File details

Details for the file emailfy-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: emailfy-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for emailfy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7a659744f0335d6f52e37fa487ce0bc248b7d37861b53605f7938a9027bd62b3
MD5 2195445150695854d546015d89bbeba2
BLAKE2b-256 c8ae2d269b79154c4af90a77cd5b4c58778c34c1326a53ebdde4487d83486fb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page