Skip to main content

This is the official python wrapper for the Blaze Verify API.

Project description

Blaze Verify Python Library

Version Build Status Maintainability

This is the official python wrapper for the Blaze Verify API.

Documentation

See the Python API docs.

Installation

pip install blazeverify

Usage

The library needs to be configured with your account's API key which is available in your Blaze Verify Dashboard.

Setup

import blazeverify

client = blazeverify.Client('live_...')

Verification

# verify an email address
response = client.verify('evan@blazeverify.com')
response.state
=> 'deliverable'

# additional parameters are available. see API docs for additional info.
client.verify('evan@blazeverify.com', smtp=False, accept_all=True, timeout=25)

Slow Email Server Handling

Some email servers are slow to respond. As a result, the timeout may be reached before we are able to complete the verification process. If this happens, the verification will continue in the background on our servers. We recommend sleeping for at least one second and trying your request again. Re-requesting the same verification with the same options will not impact your credit allocation within a 5 minute window.

A slow response will return with a 249 status code.

response = client.verify('slow@example.com')
response.status_code
=> 249
response.message
=> 'Your request is taking longer than normal. Please send your request again.'

Batch Verification

Start a batch

emails = ['evan@blazeverify.com', 'support@blazeverify.com', ...]
response = client.batch(emails)
response.id
=> '5cff27400000000000000000'

# you can optionally pass in a callback url that we'll POST to when the
# batch is complete.
response = client.batch(emails, callback_url='https://blazeverify.com/')

Get the status / results of a batch

To get the status of a batch call batch_status with the batch's id. If your batch is still being processed, you will receive a message along with the current progress of the batch. When a batch is completed, you can access the results in the emails attribute.

response = client.batch_status('5cff27400000000000000000')

# if your batch is still running
response.processed
=> 1
response.total
=> 2
response.message
=> 'Your batch is being processed.'

# if your batch is complete
response.emails
=> [{'email': 'evan@blazeverify.com', 'state': 'deliverable'...}, {'email': 'support@blazeverify.com', 'state': 'deliverable'...}...]

# get the counts
response.total_counts
=>{'deliverable': 2, 'undeliverable': 0 ...}
response.reason_counts
=>{'accepted_email': 2, 'rejected_email': 0 ...}

Development

Tests can be run with the following command:

python setup test

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/blazeverify/blazeverify-python.

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

blazeverify-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

blazeverify-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file blazeverify-1.0.0.tar.gz.

File metadata

  • Download URL: blazeverify-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.5

File hashes

Hashes for blazeverify-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b8f96c2f2aa08bd6cbf30f850a344f65bbb4c8eff1d1751eb52c04f396edd197
MD5 7c450cd7225f871156e945899a3c7163
BLAKE2b-256 2c75a433cb816d192d89e01e5018945a08b44a85fd1e0656ca907c404955380b

See more details on using hashes here.

File details

Details for the file blazeverify-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: blazeverify-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.5

File hashes

Hashes for blazeverify-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff43bdeea685089345347641548b60a01e813152ca3f6e6819f57748a677b37
MD5 da634156a5b3d211fb800e2826303de4
BLAKE2b-256 0bf75723f01e5658abe79a64878745998270ed89b5ef3fd7c27f67d39a0edfcd

See more details on using hashes here.

Supported by

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