Python client library for Email Verification API.
Project description
python-email-verifier
===================
The simplest possible way to verify an email address in Python.
Meta
----
- Author: WHOIS API, Inc.
- Email: support@whoisxmlapi.com
- Site: https://emailverification.whoisxmlapi.com/
Prerequisites
-------------
To use this library, you'll need to create a free Email Verification API account:
https://emailverification.whoisxmlapi.com/
If you haven't done this yet, please do so now.
Documentation
-------------
Documentation available `here <https://emailverification.whoisxmlapi.com/docs>`_.
Installation
------------
To install ``email-verifier`` using `pypi <https://pypi.org/>`_, simply run:
.. code-block:: console
$ pip install email-verifier
In the root of your project directory.
Usage
-----
Once you have `email-verified` installed, you can use it to easily verify any
email address.
.. code-block:: python
from emailverifier import Client
from emailverifier import exceptions
client = Client('Your-api-key')
try:
data = client.get("support@whoisxmlapi.com")
except exceptions.HttpException:
# If you get here, it means service returned HTTP error code
pass
except exceptions.GeneralException:
# If you get here, it means you cannot connect to the service
pass
except exceptions.UndefinedVariableException:
# If you get here, it means you forgot to specify the API key
pass
except exceptions.InvalidArgumentException:
# If you get here, it means you specified invalid argument
# (options should be a dictionary)
pass
except:
pass
# Something else happened related. Maybe you hit CTRL-C
# while the program was running, the kernel is killing your process, or
# something else all together.
print(data)
# Use data.json_string to get raw data in JSON.
# You can access any response field as a class property
# by converting field name from "camelCase" to "snake_case"
print("Email address: " + data.email_address)
print("Format: " + str(data.format_check))
print("DNS: " + str(data.dns_check))
print("SMTP: " + str(data.smtp_check))
print("Catch all: " + str(data.catch_all_check))
print("Disposable: " + str(data.disposable_check))
print("Free: " + str(data.free_check))
print("Last audit date: " + str(data.audit.audit_updated_date))
Here's the sort of data you might get back when performing a email verification
request:
.. code-block:: json
{
"emailAddress": "support@whoisxmlapi.com",
"formatCheck": "true",
"smtpCheck": "true",
"dnsCheck": "true",
"freeCheck": "false",
"disposableCheck": "false",
"catchAllCheck": "true",
"mxRecords": [
"ALT1.ASPMX.L.GOOGLE.com",
"ALT2.ASPMX.L.GOOGLE.com",
"ASPMX.L.GOOGLE.com",
"ASPMX2.GOOGLEMAIL.com",
"ASPMX3.GOOGLEMAIL.com",
"mx.yandex.net"
],
"audit": {
"auditCreatedDate": "2018-04-19 18:12:45.000 UTC",
"auditUpdatedDate": "2018-04-19 18:12:45.000 UTC"
}
}
===================
The simplest possible way to verify an email address in Python.
Meta
----
- Author: WHOIS API, Inc.
- Email: support@whoisxmlapi.com
- Site: https://emailverification.whoisxmlapi.com/
Prerequisites
-------------
To use this library, you'll need to create a free Email Verification API account:
https://emailverification.whoisxmlapi.com/
If you haven't done this yet, please do so now.
Documentation
-------------
Documentation available `here <https://emailverification.whoisxmlapi.com/docs>`_.
Installation
------------
To install ``email-verifier`` using `pypi <https://pypi.org/>`_, simply run:
.. code-block:: console
$ pip install email-verifier
In the root of your project directory.
Usage
-----
Once you have `email-verified` installed, you can use it to easily verify any
email address.
.. code-block:: python
from emailverifier import Client
from emailverifier import exceptions
client = Client('Your-api-key')
try:
data = client.get("support@whoisxmlapi.com")
except exceptions.HttpException:
# If you get here, it means service returned HTTP error code
pass
except exceptions.GeneralException:
# If you get here, it means you cannot connect to the service
pass
except exceptions.UndefinedVariableException:
# If you get here, it means you forgot to specify the API key
pass
except exceptions.InvalidArgumentException:
# If you get here, it means you specified invalid argument
# (options should be a dictionary)
pass
except:
pass
# Something else happened related. Maybe you hit CTRL-C
# while the program was running, the kernel is killing your process, or
# something else all together.
print(data)
# Use data.json_string to get raw data in JSON.
# You can access any response field as a class property
# by converting field name from "camelCase" to "snake_case"
print("Email address: " + data.email_address)
print("Format: " + str(data.format_check))
print("DNS: " + str(data.dns_check))
print("SMTP: " + str(data.smtp_check))
print("Catch all: " + str(data.catch_all_check))
print("Disposable: " + str(data.disposable_check))
print("Free: " + str(data.free_check))
print("Last audit date: " + str(data.audit.audit_updated_date))
Here's the sort of data you might get back when performing a email verification
request:
.. code-block:: json
{
"emailAddress": "support@whoisxmlapi.com",
"formatCheck": "true",
"smtpCheck": "true",
"dnsCheck": "true",
"freeCheck": "false",
"disposableCheck": "false",
"catchAllCheck": "true",
"mxRecords": [
"ALT1.ASPMX.L.GOOGLE.com",
"ALT2.ASPMX.L.GOOGLE.com",
"ASPMX.L.GOOGLE.com",
"ASPMX2.GOOGLEMAIL.com",
"ASPMX3.GOOGLEMAIL.com",
"mx.yandex.net"
],
"audit": {
"auditCreatedDate": "2018-04-19 18:12:45.000 UTC",
"auditUpdatedDate": "2018-04-19 18:12:45.000 UTC"
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
email-verifier-1.0.0.tar.gz
(5.3 kB
view details)
Built Distribution
File details
Details for the file email-verifier-1.0.0.tar.gz
.
File metadata
- Download URL: email-verifier-1.0.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39444abcd17aa637cfd0cc34c175c935e316ed834b1827825c14df44b9c308e6 |
|
MD5 | fcf40008323cf22186ebfb1a10133195 |
|
BLAKE2b-256 | fcaf89e492c11e755120ecbe3ed318f89cb39b56b2576fe6e69baa3601e1f360 |
File details
Details for the file email_verifier-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: email_verifier-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0551fd28178736371db3dcaaf6ea44c937951734980f6e35418912050e6c6e03 |
|
MD5 | 789e7c7fa9d82bec868c98ca0d0cb57d |
|
BLAKE2b-256 | d3f48789196ceecf7347ff7175c88f99b389538259ec7e06627c5d7319952286 |