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

Uploaded Source

Built Distributions

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

Uploaded Python 2Python 3

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

Uploaded Python 2

File details

Details for the file pymailcheck-1.0.0rc2.zip.

File metadata

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

File hashes

Hashes for pymailcheck-1.0.0rc2.zip
Algorithm Hash digest
SHA256 58b0374400edcb8805871402d25ee27c25f752b48ab9f3b1584f381cf1c32cbb
MD5 9fa071d2c3c54a89dcd8669f2c388cb9
BLAKE2b-256 656cdaca6ae25c7566bfea7a82ca5064d2d4dcf52df97db47c02d5fec857d2e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymailcheck-1.0.0rc2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0f16003bdfc6cfa873324045722632cd93b9b972955363e3749613e3c6362821
MD5 0bfc342735a945b4df2e64da3b1c03b6
BLAKE2b-256 4af4d6e60e408501e63dfbc59f07e91aaca49c70411cb6db1c75b54edbaa11b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymailcheck-1.0.0rc2-py2-none-any.whl
Algorithm Hash digest
SHA256 3cf6e17b5aa7440a340b9767304cb4bf1547d33758132daaae6023ea50272f39
MD5 727a67121d363c3fe52ee6f2697c7f56
BLAKE2b-256 84a30402f895b9fb0326f25c9328371ac2c3b5aa4ae18de8596325d3315e3981

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