Skip to content

Validates email addresses according to RFC 2822.

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

noelbush-xx/py_email_validation

Repository files navigation

RFC 2822 - style email validation for Python

(c) 2011 Noel Bush [email protected]

This code is made available to you under the GNU LGPL v3.

This module provides a single method, valid_email_address(), which returns True or False to indicate whether a given address is valid according to the 'addr-spec' part of the specification given in RFC 2822. Ideally, we would like to find this in some other library, already thoroughly tested and well- maintained. The standard Python library email.utils contains a parse_addr() function, but it is not sufficient to detect many malformed addresses.

This implementation aims to be faithful to the RFC, with the exception of a circular definition (see comments inline), and with the omission of the pattern components marked as "obsolete".

Yes, all this really does is build a big regular expression. But it builds it in nice pieces that correspond to the RFC, and there's a big bunch of unit tests that try to ensure each little piece of the regexp works as intended. (See test_email_validation.py.)

About

Validates email addresses according to RFC 2822.

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages