GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - emailable/emailable-python: Python bindings for the Emailable API

BranchesTags
Open more actions menu

Latest commit

 

History

77 Commits
77 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
emailable
emailable
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
VERSION
VERSION
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

Emailable Python Library

Version Build Status

This is the official python wrapper for the Emailable API.

Documentation

See the Python API docs.

Installation

pip install emailable

Usage

Authentication

The Emailable API requires either an API key or an access token for authentication. API keys can be created and managed in the Emailable Dashboard.

An API key can be set globally for the Emailable client:

client = emailable.Client('your_api_key')

Or, you can specify an api_key or an access_token with each request:

# set api_key at request time
client.verify(api_key='your_api_key')

# set access_token at request time
client.verify(access_token='your_access_token')

Verification

# verify an email address
response = client.verify('[email protected]')
response.state
=> 'deliverable'

# additional parameters are available. see API docs for more info.
client.verify('[email protected]', 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('[email protected]')
response.status_code
=> 249
response.message
=> 'Your request is taking longer than normal. Please send your request again.'

Batch Verification

Start a batch

emails = ['[email protected]', '[email protected]', ...]
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': '[email protected]', 'state': 'deliverable'...}, {'email': '[email protected]', '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

Cutting a Release

Run make release VERSION=x.y.z on an up to date master with a clean tree, then git push --follow-tags. It runs the tests, bumps VERSION, commits, and tags x.y.z. Pushing the tag triggers the release workflow, which publishes to PyPI and creates the GitHub release.

Contributing

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

About

Python bindings for the Emailable API

emailable.com

Topics

api-clientdeliverabilityemailemail-checkeremail-deliverabilityemail-validationemail-validation-apiemail-verificationemail-verification-apiemailablepythonsdkvalidationverification

Resources

Readme
MIT license
Activity
Custom properties

Stars

14 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.