API library for the NeverBounce email verification service.
Project description
Python API wrapper library for the NeverBounce email verification service.
Installation
$ pip install neverbounce
The only dependency is the requests library.
Usage
Sign up to get an API username and key and 1000 free monthly verifications. The free account supports only single verifications.
Single verification
>>> from neverbounce import NeverBounce
>>> neverbounce = NeverBounce('my_api_username', 'my_api_key')
>>> verified_email = neverbounce.verify('some.email@example.com')
>>> verified_email.result_text
'valid'
>>> verified_email.result_code
0
>>> verified_email.is_valid
True
>>> str(verified_email)
'some.email@example.com: valid'
Bulk verification
To use this features you need to configure a payment method in NeverBounce account settings.
>>> from neverbounce import NeverBounce
>>> neverbounce = NeverBounce('my_api_username', 'my_api_key')
Create the job and get it’s id:
>>> emails = ['some.email@example.com', 'john.doe@gmail.com']
>>> job_id = neverbounce.create_job(emails).job_id
Periodically poll for the verification job result:
>>> job_status = neverbounce.check_job(job_id)
Retrieve the result when the job is completed:
>>> if job_status.is_completed:
>>> verified_emails = neverbounce.retrieve_job(job_id)
>>> for email in verified_emails:
>>> print(str(email))
'some.email@example.com: valid'
'john.doe@gmail.com: invalid'
Documentation
Build status
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
neverbounce-0.1.3.tar.gz
(7.3 kB
view hashes)