Skip to main content

This is the official python wrapper for the Emailable API.

Project description

Emailable Python Library

Version Build Status Maintainability

This is the official python wrapper for the Emailable API.

Documentation

See the Python API docs.

Installation

pip install emailable

Usage

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

Setup

import emailable

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

Verification

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

# additional parameters are available. see API docs for additional info.
client.verify('evan@emailable.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@emailable.com', 'support@emailable.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, {'url': 'https://emailable.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@emailable.com', 'state': 'deliverable'...}, {'email': 'support@emailable.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:

pytest

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/emailable/emailable-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

emailable-3.0.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

emailable-3.0.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file emailable-3.0.2.tar.gz.

File metadata

  • Download URL: emailable-3.0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for emailable-3.0.2.tar.gz
Algorithm Hash digest
SHA256 3a79e0b593cf69decebb5f3443b84b48d2ca96071547b93d9278c62d4b1c4605
MD5 88c096fd648d44ef440e868e07d1248f
BLAKE2b-256 534245f5a7ca51261c2189bb4ebe48c6c081b040b40dd92a72fec90f3dc4c912

See more details on using hashes here.

File details

Details for the file emailable-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: emailable-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for emailable-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 298bb496aa73a9030810483dae3b41803bb494e2af7547329cdb2a67f403f479
MD5 6c2a4fc121ff2b7bfd85cc2dc4ede4aa
BLAKE2b-256 93dccaac6a9eb8fb3b74d5323a55a550cdf09f5ce0638f306f5d4d462c96c2b7

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