email-validator

Robust email address syntax and deliverability validation for Python

Library
PyPI
v2.3.0
1,449 stars
Unlicense

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
59 /100 Fair
Development Activity 52
Maintenance 24
Community 60
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
71 /100 Good
Architecture 74
Code Quality 76
Innovation 62
Learning Curve 70

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

AI Development · Automation · Devops

42,358

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

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 5 days ago
Python
44%
MIT

/dev/push

Developer Tools · Devops

4,757

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
Python 44%
HTML 31%
CSS 17%
Updated 7 months ago
Go
46%
Apache 2.0

e2a

AI Agents · Automation

191

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
79
Repo Health
80
Technical
72
Dependency
Built with
Go 46%
TypeScript 27%
Python 13%
Updated 5 days ago
Python
63%
BSD 3

Flagsmith

Ab Testing Experimentation · Developer Tools · Devops

6,577

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
90
Repo Health
82
Technical
63
Dependency
Built with
Python 63%
TypeScript 31%
Updated 1 weeks ago
TypeScript
53%
Apache 2.0

Flowsint

Automation · Developer Tools

8,978

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
67
Dependency
Built with
TypeScript 53%
Python 45%
Updated 1 weeks ago
JavaScript
88%
GPL 3.0

Glass by Pickle

AI Assistants

7,604

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
43
Repo Health
76
Technical
68
Dependency
Built with
JavaScript 88%
TypeScript 12%
Updated 11 months ago
Python
51%
AGPL 3.0

Khoj

AI Assistants · Knowledge Management · Productivity

37,526

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
63
Repo Health
82
Technical
66
Dependency
Built with
Python 51%
TypeScript 36%
Updated 2 months ago
Python
86%
Apache 2.0

knowhere

AI Development · AI Memory · Developer Tools

3,541

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

View details
82
Repo Health
75
Technical
66
Dependency
Built with
Python 86%
HTML 14%
Updated 1 weeks ago
Python
69%
MIT

Langflow

AI Agents · AI Development

155,319

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

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 69%
TypeScript 22%
Updated 5 days ago

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