Skip to main content

Simple, robust email validation

Project description

Latest version released on PyPI travis Test coverage downloads

Getting Started

pyIsEmail is a no-nonsense approach for checking whether that user-supplied email address could be real. Sick of not being able to use email address tagging to sort through your Bacn? We can fix that.

Regular expressions are cheap to write, but often require maintenance when new top-level domains come out or don’t conform to email addressing features that come back into vogue. pyIsEmail allows you to validate an email address – and even check the domain, if you wish – with one simple call, making your code more readable and faster to write. When you want to know why an email address doesn’t validate, we even provide you with a diagnosis.

Install

Install from PyPI using pip, a package manager for Python.

$ pip install pyIsEmail

Don’t have pip installed? Try installing it by running this from the command line:

$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python

Or you can download the source code (zip) for pyIsEmail and then run:

$ python setup.py install

You may need to run the above commands with sudo.

Usage

For the simplest usage, import and use the is_email function:

from pyisemail import is_email

address = "test@example.com"
bool_result = is_email(address)
detailed_result = is_email(address, diagnose=True)

You can also check whether the domain used in the email is a valid domain and whether or not it has a valid MX record:

from pyisemail import is_email

address = "test@example.com"
bool_result_with_dns = is_email(address, check_dns=True)
detailed_result_with_dns = is_email(address, check_dns=True, diagnose=True)

These are primary indicators of whether an email address can even be issued at that domain. However, a valid response here is not a guarantee that the email exists, merely that is can exist.

In addition to the base is_email functionality, you can also use the validators by themselves. Check the validator source doe to see how this works.

Uninstall

Want to get rid of pyIsEmail? Did you install with pip? Here you go:

$ pip uninstall pyIsEmail

Acknowledgements

The base ParserValidator is based off of Dominic Sayersis_email script. I wanted the functionality in Python, so I ported it from the original PHP.

Contributing

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am 'Add some feature')

  4. Push to the branch (git push origin my-new-feature)

  5. Create a new Pull Request

Versioning

This library aims to adhere to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs.

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

pyIsEmail-1.3.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyIsEmail-1.3.2-py2.py3-none-any.whl (23.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyIsEmail-1.3.2.tar.gz.

File metadata

  • Download URL: pyIsEmail-1.3.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyIsEmail-1.3.2.tar.gz
Algorithm Hash digest
SHA256 665af6de136868b3aceea9198d3f0fe673582492ad7d3e863108118b2296e551
MD5 dd7952fc6d25b33bb5e1488bcae03869
BLAKE2b-256 f8b7dae3645caa275ae1bcd26996f6670db7326af73e31053a95a87f2064401e

See more details on using hashes here.

File details

Details for the file pyIsEmail-1.3.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyIsEmail-1.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 83b7da38a8547bca34e45390f34df15d8bc062b045979883b6347376875f2d8c
MD5 24e9a3a516a6b1d3753a1a968aaaeac9
BLAKE2b-256 2cdafd122a2496f91cd0f99e2e92e82f25966a73a1aeda93398d4f712504ff5c

See more details on using hashes here.

Supported by

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