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

$ pip install pymailcheck

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.0.zip (5.3 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 2Python 3

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

Uploaded Python 2

File details

Details for the file pymailcheck-1.0.0.zip.

File metadata

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

File hashes

Hashes for pymailcheck-1.0.0.zip
Algorithm Hash digest
SHA256 e5ab28bffafd51eae86aecdb6aed71b0fd383ac372b773c29d44f0658662fd9a
MD5 21e6c676bc654135e2add40f4e168356
BLAKE2b-256 55681647b2a673cf5daa1a7b75c5ebab20acf2f1f3e7e68f7eaefabb361bc897

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymailcheck-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 29dbad220525507c72ea15d26af2c911d71a192ad34fe60f393a90256f37e1d2
MD5 d6b90f0f7ed3cb1ebae3c11206654b3c
BLAKE2b-256 d2876b57fd85d24c55cc58cb8b9ca726e443fe1696d003434fa534593dc60be8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymailcheck-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 9837b763d1e10a7988d91ddf47004297e7087d5ffccf2bae46bd9325e3318cdd
MD5 4353eb11a676636f3e5f66740daa4127
BLAKE2b-256 9145e56d586d1c99307e858aecdad70399d54bc7115b34d8d31bf80665faf850

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