emailable


Nameemailable JSON
Version 3.0.1 PyPI version JSON
download
home_pagehttps://github.com/emailable/emailable-python
SummaryThis is the official python wrapper for the Emailable API.
upload_time2023-09-11 21:07:21
maintainer
docs_urlNone
authorEmailable
requires_python>=3.6
licenseMIT
keywords emailable email verification
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # Emailable Python Library

[![Version](https://img.shields.io/pypi/v/emailable.svg)](https://pypi.org/project/emailable/)
[![Build Status](https://app.travis-ci.com/emailable/emailable-python.svg)](https://app.travis-ci.com/emailable/emailable-python)
[![Maintainability](https://api.codeclimate.com/v1/badges/dcb962c96795974051fc/maintainability)](https://codeclimate.com/github/emailable/emailable-python/maintainability)

This is the official python wrapper for the Emailable API.

## Documentation

See the [Python API docs](https://emailable.com/docs/api/?python).

## Installation

```shell
pip install emailable
```

## Usage

The library needs to be configured with your account's API key which is available in your [Emailable Dashboard](https://app.emailable.com/api).

### Setup

```python
import emailable

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

### Verification

```python
# 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.

```python
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

```python
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.

```python
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:

```shell
python setup.py test
```

## Contributing

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/emailable/emailable-python",
    "name": "emailable",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "emailable email verification",
    "author": "Emailable",
    "author_email": "support@emailable.com",
    "download_url": "https://files.pythonhosted.org/packages/d2/99/8aaf5bd42b6c2b0f472297a5187ddd5f258dfde304d5d9b65ae6a7a2d071/emailable-3.0.1.tar.gz",
    "platform": null,
    "description": "# Emailable Python Library\n\n[![Version](https://img.shields.io/pypi/v/emailable.svg)](https://pypi.org/project/emailable/)\n[![Build Status](https://app.travis-ci.com/emailable/emailable-python.svg)](https://app.travis-ci.com/emailable/emailable-python)\n[![Maintainability](https://api.codeclimate.com/v1/badges/dcb962c96795974051fc/maintainability)](https://codeclimate.com/github/emailable/emailable-python/maintainability)\n\nThis is the official python wrapper for the Emailable API.\n\n## Documentation\n\nSee the [Python API docs](https://emailable.com/docs/api/?python).\n\n## Installation\n\n```shell\npip install emailable\n```\n\n## Usage\n\nThe library needs to be configured with your account's API key which is available in your [Emailable Dashboard](https://app.emailable.com/api).\n\n### Setup\n\n```python\nimport emailable\n\nclient = emailable.Client('live_...')\n```\n\n### Verification\n\n```python\n# verify an email address\nresponse = client.verify('evan@emailable.com')\nresponse.state\n=> 'deliverable'\n\n# additional parameters are available. see API docs for additional info.\nclient.verify('evan@emailable.com', smtp=False, accept_all=True, timeout=25)\n```\n\n#### Slow Email Server Handling\n\nSome email servers are slow to respond. As a result, the timeout may be reached\nbefore we are able to complete the verification process. If this happens, the\nverification will continue in the background on our servers. We recommend\nsleeping for at least one second and trying your request again. Re-requesting\nthe same verification with the same options will not impact your credit\nallocation within a 5 minute window.\n\nA slow response will return with a 249 status code.\n\n```python\nresponse = client.verify('slow@example.com')\nresponse.status_code\n=> 249\nresponse.message\n=> 'Your request is taking longer than normal. Please send your request again.'\n```\n\n### Batch Verification\n\n#### Start a batch\n\n```python\nemails = ['evan@emailable.com', 'support@emailable.com', ...]\nresponse = client.batch(emails)\nresponse.id\n=> '5cff27400000000000000000'\n\n# you can optionally pass in a callback url that we'll POST to when the\n# batch is complete.\nresponse = client.batch(emails, {'url': 'https://emailable.com/'})\n```\n\n#### Get the status / results of a batch\n\nTo 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.\n\n```python\nresponse = client.batch_status('5cff27400000000000000000')\n\n# if your batch is still running\nresponse.processed\n=> 1\nresponse.total\n=> 2\nresponse.message\n=> 'Your batch is being processed.'\n\n# if your batch is complete\nresponse.emails\n=> [{'email': 'evan@emailable.com', 'state': 'deliverable'...}, {'email': 'support@emailable.com', 'state': 'deliverable'...}...]\n\n# get the counts\nresponse.total_counts\n=>{'deliverable': 2, 'undeliverable': 0 ...}\nresponse.reason_counts\n=>{'accepted_email': 2, 'rejected_email': 0 ...}\n```\n\n## Development\n\nTests can be run with the following command:\n\n```shell\npython setup.py test\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/emailable/emailable-python.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This is the official python wrapper for the Emailable API.",
    "version": "3.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/emailable/emailable-python/issues",
        "Documentation": "https://emailable.com/docs/api?python",
        "Homepage": "https://github.com/emailable/emailable-python",
        "Source Code": "https://github.com/emailable/emailable-python"
    },
    "split_keywords": [
        "emailable",
        "email",
        "verification"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da6fde4f8f9454c231518bb7f21f7d681c6bbd5c30a8d6e71c9447692b5ce209",
                "md5": "4d51dc5438141430aba60033a14f80d7",
                "sha256": "7c6c9da5ab2ca12967608396232f0aa2314f8fc4b2646a3e0dc1384362e83b1c"
            },
            "downloads": -1,
            "filename": "emailable-3.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4d51dc5438141430aba60033a14f80d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5054,
            "upload_time": "2023-09-11T21:07:20",
            "upload_time_iso_8601": "2023-09-11T21:07:20.759764Z",
            "url": "https://files.pythonhosted.org/packages/da/6f/de4f8f9454c231518bb7f21f7d681c6bbd5c30a8d6e71c9447692b5ce209/emailable-3.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2998aaf5bd42b6c2b0f472297a5187ddd5f258dfde304d5d9b65ae6a7a2d071",
                "md5": "440e76c42f3ffe901321cddf71843d7e",
                "sha256": "5f69590f4952bda735b040d13857ac27f45694f995210f74905ec4b85218595c"
            },
            "downloads": -1,
            "filename": "emailable-3.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "440e76c42f3ffe901321cddf71843d7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5152,
            "upload_time": "2023-09-11T21:07:21",
            "upload_time_iso_8601": "2023-09-11T21:07:21.715716Z",
            "url": "https://files.pythonhosted.org/packages/d2/99/8aaf5bd42b6c2b0f472297a5187ddd5f258dfde304d5d9b65ae6a7a2d071/emailable-3.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-11 21:07:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "emailable",
    "github_project": "emailable-python",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "emailable"
}
        
Elapsed time: 0.10848s