email-validator

Robust email address syntax and deliverability validation for Python

Library
PyPI
v2.3.0
1,433stars
Unlicense

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
56/100Fair
Development Activity36
Maintenance28
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
71/100Good
Architecture74
Code Quality76
Innovation62
Learning Curve70

email-validator is an opinionated Python library that checks whether a string is a well-formed, deliverable email address. It validates syntax against RFC rules, supports internationalized domain names and local parts, and optionally performs DNS-based deliverability checks (MX/A/AAAA records) so applications can reject unreachable domains before storing them.

Beyond a pass/fail check, it returns a normalized form of the address that should be stored and compared going forward, along with structured fields like the ASCII-ized form, display name, and parsed domain-literal IP addresses when applicable. It deliberately rejects obsolete or unsafe address forms (special-use domains, unsafe Unicode) that would otherwise cause grief in registration and login flows.

What You Get

  • validate_email() returning a normalized address plus ASCII-ized, display-name, and domain-literal fields
  • EmailSyntaxError and EmailUndeliverableError exception classes (both subclasses of EmailNotValidError/ValueError) with friendly, end-user-displayable messages
  • Optional DNS-based deliverability checks (MX record lookup with A/AAAA fallback) via a pluggable dns.resolver.Resolver
  • A caching_resolver() helper for reusing DNS lookups across many validations with a timeout and LRU cache
  • Support for internationalized domain names (IDNA 2008) and internationalized/quoted local parts
  • Configurable options for quoted-local-parts, domain literals, display names, empty local parts, and stricter RFC compliance

Common Use Cases

  • Validating email addresses on account registration forms before writing them to a database
  • Normalizing stored email addresses so duplicate-detection and login lookups are consistent
  • Skipping DNS checks on login forms (check_deliverability=False) while enforcing them at signup
  • Accepting internationalized email addresses (non-ASCII domains and local parts) correctly
  • Allowing test-only @test/@*.test domains in non-production environments via test_environment=True

Under The Hood

Architecture: The library is a small, focused pipeline: syntax.py implements RFC-5321/5322/6531-aware parsing of the local part and domain, rfc_constants.py centralizes the character-class and length constants those checks rely on, deliverability.py performs the optional DNS MX/A/AAAA lookups through a caller-supplied or default dns.resolver.Resolver, and validate_email.py in email_validator/ orchestrates the two stages and assembles the returned ValidatedEmail object defined in types.py. exceptions.py defines the EmailNotValidError hierarchy consumed by callers.

Tech Stack: Pure Python 3.10+ with dnspython and idna as the only meaningful runtime dependencies (for DNS resolution and IDNA 2008 domain encoding respectively). Packaged with setuptools/pyproject.toml, distributed as a universal wheel, and ships py.typed for full type-annotation support in consuming codebases.

Code Quality: tests/test_syntax.py, tests/test_deliverability.py, and tests/test_main.py cover syntax edge cases (IDN, quoted locals, domain literals), DNS-check behavior, and CLI usage; CI runs them via GitHub Actions (test_and_build.yaml) across supported Python versions. Error paths are modeled as typed exceptions with descriptive messages rather than generic ValueErrors, and the codebase is fully type-annotated.

API Design: The primary entry point is a single function, validate_email(email, **options), with all behavior controlled by well-documented keyword arguments and module-level defaults (e.g. email_validator.CHECK_DELIVERABILITY) that can be set once for an app. This keeps the common case (‘is this address valid, and what’s its normalized form’) to two or three lines, while advanced options (quoted locals, domain literals, custom resolvers) stay opt-in rather than cluttering the default call.

Used by 14 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
44%
MIT

/dev/push

Developer Tools · Devops

4,742

Self-hosted, open-source Vercel alternative that deploys Python, Node.js, PHP, and any Docker-compatible app from a Git push, with zero-downtime rollouts and real-time logs.

View details
44
Repo Health
68
Technical
73
Dependency
Built with
Python44%
HTML31%
CSS17%
Updated 5 months ago
Go
42%
Apache 2.0

e2a

AI Agents · Automation

182

Give your AI agents a real, authenticated email address — with SPF/DKIM-verified inbound, HMAC-signed delivery, WebSocket fan-out, and human-in-the-loop approval built in.

View details
78
Repo Health
80
Technical
76
Dependency
Built with
Go42%
TypeScript28%
Python15%
Updated today
Python
64%
BSD 3

Flagsmith

Developer Tools · Devops · Ab Testing Experimentation

6,518

Open-source feature flagging, remote config, and A/B/multivariate testing platform for web, mobile, and server-side apps — self-host or use the hosted SaaS.

View details
91
Repo Health
82
Technical
65
Dependency
Built with
Python64%
TypeScript31%
Updated today
TypeScript
53%
Apache 2.0

Flowsint

Automation · Developer Tools

7,669

A privacy-first, graph-based OSINT investigation platform with 30+ automated enrichers for mapping relationships between domains, IPs, people, and organizations.

View details
84
Repo Health
71
Technical
70
Dependency
Built with
TypeScript53%
Python45%
Updated 1 weeks ago
JavaScript
88%
GPL 3.0

Glass by Pickle

AI Assistants

7,577

A privacy-first desktop AI assistant that sees your screen, hears your meetings, and turns live context into structured summaries—without sending a single byte to the cloud.

View details
46
Repo Health
76
Technical
68
Dependency
Built with
JavaScript88%
TypeScript12%
Updated 9 months ago
Python
51%
AGPL 3.0

Khoj

AI Assistants · Knowledge Management · Productivity

36,555

A self-hostable AI second brain that chats with your documents, searches the web, builds custom agents, and runs entirely on your own LLM.

View details
77
Repo Health
82
Technical
70
Dependency
Built with
Python51%
TypeScript36%
Updated 2 weeks ago
Python
83%
Apache 2.0

knowhere

AI Development · Developer Tools

2,515

Transform messy, unstructured documents into persistent, navigable memory that AI agents can actually use.

View details
83
Repo Health
75
Technical
70
Dependency
Built with
Python83%
HTML16%
Updated today
Python
68%
MIT

Langflow

AI Agents · AI Development

153,450

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
66
Dependency
Built with
Python68%
TypeScript22%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search