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.

Installation

$ python setup.py install

Usage

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

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

yahoo.com

top_level_domains

pymailcheck.TOP_LEVEL_DOMAINS

yahoo

second_level_domains

pymailcheck.SECOND_LEVEL_DOMAINS

com

>>> pymailcheck.suggest("test@contosl.com")
False
>>> custom_domains = ["example.com", "contoso.com"]
>>> pymailcheck.suggest("test@contosl.com", domains=custom_domains)
{'domain': 'contoso.com', 'full': 'test@contoso.com', 'address': 'test'}
>>> pymailcheck.suggest("test@contosl.com")
False
>>> custom_domains = pymailcheck.DOMAINS.union(("example.com", "contoso.com"))
>>> pymailcheck.suggest("test@contosl.com", domains=custom_domains)
{'domain': 'contoso.com', 'full': 'test@contoso.com', '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.

Source Distribution

pymailcheck-1.0.0rc1.zip (5.3 kB view details)

Uploaded Source

Built Distributions

pymailcheck-1.0.0rc1-py2.py3-none-any.whl (4.4 kB view details)

Uploaded Python 2Python 3

pymailcheck-1.0.0rc1-py2-none-any.whl (4.4 kB view details)

Uploaded Python 2

File details

Details for the file pymailcheck-1.0.0rc1.zip.

File metadata

  • Download URL: pymailcheck-1.0.0rc1.zip
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymailcheck-1.0.0rc1.zip
Algorithm Hash digest
SHA256 18795aa50e9317fd3b370a92be1287fa62e7acbb8b6d39f6b564878323dd7e7c
MD5 1a280b03838aa6d746274190a299c022
BLAKE2b-256 827f323900eba7652e75d222695c4fc3da694574ba51507ea48982a0f72eb9c7

See more details on using hashes here.

File details

Details for the file pymailcheck-1.0.0rc1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pymailcheck-1.0.0rc1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 713e09e55b996d71eb7ef6d2d72e60dc334b7e470ce5c9454ef65817a3787ef1
MD5 c5aab9bc34e7f2ee5ccfd8f9bdada93e
BLAKE2b-256 ab29a171a5a3c5da3b8bf703d4e4cac54ce5c945305aeb2780d1730c2b974578

See more details on using hashes here.

File details

Details for the file pymailcheck-1.0.0rc1-py2-none-any.whl.

File metadata

File hashes

Hashes for pymailcheck-1.0.0rc1-py2-none-any.whl
Algorithm Hash digest
SHA256 367db176d2202c453b7e156fbbcea25c4666a3c0ad083138ebf2416b99f0f5ee
MD5 7a59a260a2627b58d4048ce81feb6aad
BLAKE2b-256 3b23bdc1399c839c345c6d6e374fd53193f807ec863b9786805aa7593d495da7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page