建议更正用户拼写错误的电子邮件地址
pymailcheck的Python项目详细描述
建议更正用户拼写错误的电子邮件地址。
python端口mailcheck.js。
安装
$ pip install pymailcheck
用法
>>>importpymailcheck>>>pymailcheck.suggest("test@example.con"){'domain':'example.com','full':'test@example.com','address':'test'}>>>pymailcheck.suggest("test@example.org")False
您可以覆盖或附加域、顶级域的内置列表, 和/或二级域:
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'}
运行测试
$ python -m unittest discover