Skip to main content

Suggest corrections to user-misspelled email addresses

Project description

Suggest corrections to user-misspelled email addresses.

Python port of mailcheck.js.


$ pip install pymailcheck


>>> import pymailcheck
>>> pymailcheck.suggest("test@example.con")
{'domain': '', 'full': '', 'address': 'test'}
>>> pymailcheck.suggest("")

You can override or append the built-in list of domains, top-level domains, and/or second-level domains:

Parameter Defaults Example
domains pymailcheck.DOMAINS
top_level_domains pymailcheck.TOP_LEVEL_DOMAINS yahoo
second_level_domains pymailcheck.SECOND_LEVEL_DOMAINS com
>>> pymailcheck.suggest("")
>>> custom_domains = ["", ""]
>>> pymailcheck.suggest("", domains=custom_domains)
{'domain': '', 'full': '', 'address': 'test'}
>>> pymailcheck.suggest("")
>>> custom_domains = pymailcheck.DOMAINS.union(("", ""))
>>> pymailcheck.suggest("", domains=custom_domains)
{'domain': '', 'full': '', 'address': 'test'}

Running Tests

$ python -m unittest discover

Project details

Download files

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

Files for pymailcheck, version 1.0.0rc2
Filename, size File type Python version Upload date Hashes
Filename, size pymailcheck-1.0.0rc2-py2-none-any.whl (4.4 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size pymailcheck-1.0.0rc2-py2.py3-none-any.whl (4.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page