
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
|pypi| |ci| |coveralls| |downloads|
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.
.. _email address tagging: http://en.wikipedia.org/wiki/Email_address#Address_tags .. _Bacn: http://en.wikipedia.org/wiki/Bacn
Install from PyPI using pip
_, a package manager for Python.
.. code-block:: bash
$ pip install pyIsEmail
Don't have pip installed? Try installing it by running this from the command line:
.. code-block:: bash
$ 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:
.. code-block:: bash
$ python setup.py install
You may need to run the above commands with sudo
.
.. _pip: http://www.pip-installer.org/en/latest/ .. _download the source code (zip): https://github.com/michaelherold/pyIsEmail/zipball/master
For the simplest usage, import and use the is_email
function:
.. code-block:: python
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:
.. code-block:: python
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.
If you want to limit using a gTLD
_ as the domain part of the email
address, you can do so with a flag:
.. code-block:: python
from pyisemail import is_email
address = "thiswont@workatall"
bool_result_with_check = is_email(address, allow_gtld=False)
detailed_result_with_check = is_email(address, allow_gtld=False, diagnose=True)
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.
.. _gTLD: https://en.wikipedia.org/wiki/Generic_top-level_domain
Want to get rid of pyIsEmail? Did you install with pip? Here you go:
.. code-block:: bash
$ pip uninstall pyIsEmail
The base ParserValidator
is based off of Dominic Sayers
' is_email script
. I wanted the functionality in Python, so I ported it from the
original PHP.
.. _Dominic Sayers: https://github.com/dominicsayers .. _is_email script: https://github.com/dominicsayers/isemail
So you're interested in contributing to pyIsEmail? Check out our contributing guidelines <./CONTRIBUTING.rst>
__ for more information on how to do that.
This library aims to adhere to Semantic Versioning 2.0.0
_. Violations of
this scheme should be reported as bugs.
.. _Semantic Versioning 2.0.0: http://semver.org/
Copyright (c) 2015 Michael Herold. Open sourced under the terms of the
MIT license
_.
.. _MIT license: http://opensource.org/licenses/MIT
.. |pypi| image:: https://img.shields.io/pypi/v/pyIsEmail.svg?style=flat-square :target: https://pypi.python.org/pypi/pyIsEmail :alt: Latest version released on PyPI .. |ci| image:: https://github.com/michaelherold/pyIsEmail/actions/workflows/ci.yml/badge.svg :target: https://github.com/michaelherold/pyIsEmail/actions/workflows/ci.yml .. |coveralls| image:: https://img.shields.io/coveralls/michaelherold/pyIsEmail/master.svg?style=flat-square :target: https://coveralls.io/r/michaelherold/pyIsEmail?branch=master :alt: Test coverage .. |downloads| image:: https://img.shields.io/pypi/dm/pyIsEmail.svg?style=flat-square :target: https://pypi.python.org/pypi/pyIsEmail/
FAQs
Simple, robust email validation
We found that pyIsEmail demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.