How to validate email in Python with 5 lines of code

preview_player
Показать описание
How to validate email in Python with 5 lines of code

from email_validator import validate_email, EmailNotValidError

try:
# Validate & take the normalized form of the email
# address for all logic beyond this point (especially
# before going to a database query where equality
# does not take into account normalization).
email = validate_email(email).email
except EmailNotValidError as e:
# email is not valid, exception message is human-readable
print(str(e))
Рекомендации по теме
Комментарии
Автор

Great video -- thank you -- just used this in my app. Liked and Subscribed

shawneiharris