Skip to main content

pymailcheck

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'}
>>> def my_distance_function(s1, s2): ...
>>> # Have a look at `strsim` PyPI package, for example
>>> pymailcheck.suggest("test@contosl.com", distance_callable=my_distance_function)
{'domain': 'contoso.com', 'full': 'test@contoso.com', 'address': 'test'}

Running Tests

$ python -m unittest discover

Metadata

Release files for pymailcheck 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymailcheck 1.1.0
File Size Uploaded Provenance Actions
pymailcheck-1.1.0.tar.gz 4.7 kB Without provenance Details for pymailcheck-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymailcheck 1.1.0
File Interpreter ABI Platform Actions
pymailcheck-1.1.0-py3-none-any.whl Python 3 none any Details for pymailcheck-1.1.0-py3-none-any.whl

Total release size: 9.7 kB

Release files / pymailcheck-1.1.0.tar.gz

Download URL pymailcheck-1.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5320337794ccc124b6178bb0b9de44b1a479674f99ddd05b8558bf6c718bdc0c
BLAKE2b-256 checksum
How to use checksums
2ea297c2fdd8735f9fd73b2d6cb8fc34915027cb8dd77592860b2d4b7ec317e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.10

Release files / pymailcheck-1.1.0-py3-none-any.whl

Download URL pymailcheck-1.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5b4bb44fb65061713626f371a9c9313a1cf169bfdacd5e36391509e904a7b6b
BLAKE2b-256 checksum
How to use checksums
5673f85e65681ff1d019b9f56b51a2cfc05765a464436fbaec4effed2cf52d2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.10

Security for pymailcheck 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page