Official Python SDK for the NeverBounce API
Likely abandoned. No release or commit for years (last release over 6 years ago).
Consider insteadzerobouncesdkPythie’s Index: 80166.7K downloads/moCompare →
pip install neverbounce-sdkNeverBounceApi-Python
.. image:: https://neverbounce-marketing.s3.amazonaws.com/neverbounce_color_600px.png :target: https://neverbounce.com :width: 600 :align: center :alt: NeverBounce Logo
|travisci| |codeclimate|
Welcome to NeverBounce's Python SDK! We hope that it will aid you in consuming our service. Please report any bugs to the github issue tracker and make sure you read the documentation before use.
Installation
The preferred method of installation is with pip in a virtual environment::
pip install neverbounce_sdk
If you must use easy_install, you may. If you'd like to install for local
development::
git clone git@github.com:NeverBounce/NeverBounceApi-Python.git
cd NeverBounceApi-Python
pip install -e .
This will install neverbounce_sdk into the active environment in editable
mode.
Usage
**The API username and secret key used to authenticate V3 API requests will not work to authenticate V4 API requests.** If you are attempting to authenticate your request with the 8 character username or 12-16 character secret key the request will return an `auth_failure` error. The API key used for the V4 API will look like the following: `secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. To create new V4 API credentials please go [here](https://app.neverbounce.com/apps/custom-integration/new).
The NeverBounce Python SDK provides a simple interface by which to interact with NeverBounce's email verification API version 4. To get up and running, make sure you have your API token on hand::
import neverbounce_sdk
api_key = 'secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
client = neverbounce_sdk.client(api_key=api_key,timeout=30)
And now you're ready to use the client. You can check your account information::
info = client.account_info()
# info is {'billing_type': 'default', 'credits': 12345, ... }
You can verify single emails::
resp = client.single_check('test@example.com')
resp['result'] # 'invalid'
resp['execution_time'] # 285
And you can create, query the status of, and control email verification bulk jobs::
emails = [
{'email': 'tomato@veggies.com'}, # must have an 'email' key
{'email': 'cucumber@veggies.com',
'best_when': 'cold'}, # may contain "metadata"
]
job = client.jobs_create(emails)
# all state-changing methods return a status object
resp = client.jobs_parse(job['id'], auto_start=False)
assert resp['status'] == 'success'
client.jobs_start(job['id'])
progress = client.jobs_status(job['id'])
print(progress) # dict with keys 'job_status', 'started', 'percent_complete', etc