zerobounceindiasdk


Namezerobounceindiasdk JSON
Version 1.1.0 PyPI version JSON
download
home_page
SummaryZeroBounce India Python API - https://www.zerobounce.in.
upload_time2023-09-12 07:43:46
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords zero bounce india sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Zero Bounce India Python SDK
This SDK contains methods for interacting easily with ZeroBounce India API.
More information about ZeroBounce India you can find in the [official documentation](https://www.zerobounce.in/docs/).

## INSTALLATION
```bash
pip install zerobounceindiasdk
```

## USAGE
Import the sdk in your file:

```python
from zerobouncesdk import ZeroBounce
```

Initialize the sdk with your api key:

```python
zero_bounce = ZeroBounce("<YOUR_API_KEY>")
```

## Examples
Then you can use any of the SDK methods, for example:

* ##### Check how many credits you have left on your account
```python
from zerobouncesdk import ZeroBounce

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

response = zero_bounce.get_credits()
print("ZeroBounce get_credits response: " + str(response))
```

* ##### Check your API usage for a given period of time
```python
from datetime import datetime
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

start_date = datetime(2019, 8, 1);  # The start date of when you want to view API usage
end_date = datetime(2019, 9, 1);    # The end date of when you want to view API usage

try:
    response = zero_bounce.get_api_usage(start_date, end_date)
    print("ZeroBounce get_api_usage response: " + str(response))
except ZBException as e:
    print("ZeroBounce get_api_usage error: " + str(e))
```

* ##### Gather insights into your subscribers' overall email engagement
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

email = "valid@example.com";    # Subscriber email address

try:
    response = zero_bounce.get_activity(email)
    print("ZeroBounce get_activity response: " + str(response))
except ZBException as e:
    print("ZeroBounce get_activity error: " + str(e))
```

* ##### Identify the correct email format when you provide a name and email domain

```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

domain = "example.com" # The email domain for which to find the email format
first_name = "John" # The first name of the person whose email format is being searched
middle_name = "Quill" # The middle name of the person whose email format is being searched
last_name = "Doe" # The last name of the person whose email format is being searched

try:
    response = zero_bounce.guess_format(domain, first_name, middle_name, last_name)
    print("ZeroBounce guess format response: " + response)
except ZBException as e:
    print("ZeroBounce guess format error: " + str(e))
```

* ##### Validate an email address
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

email = "<EMAIL_ADDRESS>"   # The email address you want to validate
ip_address = "127.0.0.1"    # The IP Address the email signed up from (Optional)

try:
    response = zero_bounce.validate(email, ip_address)
    print("ZeroBounce validate response: " + str(response))
except ZBException as e:
    print("ZeroBounce validate error: " + str(e))
```

* ##### Validate a batch of up to 100 emails at a time
```python
from zerobouncesdk import ZeroBounce, ZBException, ZBValidateBatchElement

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

email_batch = [
    ZBValidateBatchElement("valid@example.com", "127.0.0.1"),
    ZBValidateBatchElement("invalid@example.com"),
]                   # The batch of emails you want to validate

try:
    response = zero_bounce.validate_batch(email_batch)
    print("ZeroBounce validate_batch response: " + str(response))
except ZBException as e:
    print("ZeroBounce validate_batch error: " + str(e))
```

* ##### The _sendFile_ API allows user to send a file for bulk email validation
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_path = './email_file.csv'  # The csv or txt file
email_address_column = 1        # The index of "email" column in the file. Index starts at 1

return_url = "https://domain.com/called/after/processing/request"

first_name_column = None        # The index of "first name" column in the file
last_name_column = None         # The index of "last name" column in the file
gender_column = None            # The index of "gender" column in the file
ip_address_column = None        # The index of "IP address" column in the file
has_header_row = False          # If the first row from the submitted file is a header row
remove_duplicate = True         # If you want the system to remove duplicate emails

try:
    response = zero_bounce.send_file(
        file_path,
        email_address_column,
        return_url,
        first_name_column,
        last_name_column,
        gender_column,
        ip_address_column,
        has_header_row,
        remove_duplicate,
    )
    print("ZeroBounce send_file response: " + str(response))
except ZBException as e:
    print("ZeroBounce send_file error: " + str(e))
```

* ##### Check the status of a file uploaded via _sendFile_ method
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_id = "<FILE_ID>"       # The returned file ID when calling sendFile API

try:
    response = zero_bounce.file_status(file_id)
    print("ZeroBounce file_status response: " + str(response))
except ZBException as e:
    print("ZeroBounce file_status error: " + str(e))
```

* ##### The _getfile_ API allows users to get the validation results file for the file been submitted using _sendFile_ API
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_id="<FILE_ID>"                         # The returned file ID when calling sendFile API
local_download_path = "./dwnld_file.csv"    # The path where the file will be downloaded

try:
    response = zero_bounce.get_file(file_id, local_download_path)
    print("ZeroBounce get_file response: " + str(response))
except ZBException as e:
    print("ZeroBounce get_file error: " + str(e))
```

* ##### Delete the file that was submitted using _sendFile_ API. File can be deleted only when its status is `Complete`
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_id="<FILE_ID>"     # The returned file ID when calling sendFile API

try:
    response = zero_bounce.delete_file(file_id)
    print("ZeroBounce delete_file response: " + str(response))
except ZBException as e:
    print("ZeroBounce delete_file error: " + str(e))
```

### AI Scoring API

* ##### The _scoringSendFile_ API allows user to send a file for bulk email scoring
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_path = './email_file.csv'  # The csv or txt file
email_address_column = 1        # The index of "email" column in the file. Index starts at 1

return_url = "https://domain.com/called/after/processing/request"

has_header_row = False          # If the first row from the submitted file is a header row
remove_duplicate = True         # If you want the system to remove duplicate emails

try:
    response = zero_bounce.scoring_send_file(
        file_path,
        email_address_column,
        return_url,
        has_header_row,
        remove_duplicate,
    )
    print("ZeroBounce send_file response: " + str(response))
except ZBException as e:
    print("ZeroBounce send_file error: " + str(e))
```

* ##### Check the status of a file uploaded via _scoringSendFile_ method
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_id = "<FILE_ID>"       # The returned file ID when calling scoringSendFile API

try:
    response = zero_bounce.scoring_file_status(file_id)
    print("ZeroBounce file_status response: " + str(response))
except ZBException as e:
    print("ZeroBounce file_status error: " + str(e))
```

* ##### The scoring _scoringGetFile_ API allows users to get the validation results file for the file been submitted using scoring _scoringSendFile_ API
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_id="<FILE_ID>"                         # The returned file ID when calling scoringSendFile API
local_download_path = "./dwnld_file.csv"    # The path where the file will be downloaded

try:
    response = zero_bounce.scoring_get_file(file_id, local_download_path)
    print("ZeroBounce get_file response: " + str(response))
except ZBException as e:
    print("ZeroBounce get_file error: " + str(e))
```

* ##### Delete the file that was submitted using _scoringSendFile_ API. File can be deleted only when its status is `Complete`
```python
from zerobouncesdk import ZeroBounce, ZBException

zero_bounce = ZeroBounce("<YOUR_API_KEY>")

file_id="<FILE_ID>"     # The returned file ID when calling scoringSendFile API

try:
    response = zero_bounce.scoring_delete_file(file_id)
    print("ZeroBounce delete_file response: " + str(response))
except ZBException as e:
    print("ZeroBounce delete_file error: " + str(e))
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "zerobounceindiasdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "zero,bounce,india,sdk",
    "author": "",
    "author_email": "ZeroBounce <support@zerobounce.net>",
    "download_url": "https://files.pythonhosted.org/packages/89/60/c63e3051c523bde7531cfb99a2f79c8e7e5b118d36d2a7ddf55da2af6ec6/zerobounceindiasdk-1.1.0.tar.gz",
    "platform": null,
    "description": "## Zero Bounce India Python SDK\nThis SDK contains methods for interacting easily with ZeroBounce India API.\nMore information about ZeroBounce India you can find in the [official documentation](https://www.zerobounce.in/docs/).\n\n## INSTALLATION\n```bash\npip install zerobounceindiasdk\n```\n\n## USAGE\nImport the sdk in your file:\n\n```python\nfrom zerobouncesdk import ZeroBounce\n```\n\nInitialize the sdk with your api key:\n\n```python\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n```\n\n## Examples\nThen you can use any of the SDK methods, for example:\n\n* ##### Check how many credits you have left on your account\n```python\nfrom zerobouncesdk import ZeroBounce\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nresponse = zero_bounce.get_credits()\nprint(\"ZeroBounce get_credits response: \" + str(response))\n```\n\n* ##### Check your API usage for a given period of time\n```python\nfrom datetime import datetime\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nstart_date = datetime(2019, 8, 1);  # The start date of when you want to view API usage\nend_date = datetime(2019, 9, 1);    # The end date of when you want to view API usage\n\ntry:\n    response = zero_bounce.get_api_usage(start_date, end_date)\n    print(\"ZeroBounce get_api_usage response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce get_api_usage error: \" + str(e))\n```\n\n* ##### Gather insights into your subscribers' overall email engagement\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nemail = \"valid@example.com\";    # Subscriber email address\n\ntry:\n    response = zero_bounce.get_activity(email)\n    print(\"ZeroBounce get_activity response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce get_activity error: \" + str(e))\n```\n\n* ##### Identify the correct email format when you provide a name and email domain\n\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\ndomain = \"example.com\" # The email domain for which to find the email format\nfirst_name = \"John\" # The first name of the person whose email format is being searched\nmiddle_name = \"Quill\" # The middle name of the person whose email format is being searched\nlast_name = \"Doe\" # The last name of the person whose email format is being searched\n\ntry:\n    response = zero_bounce.guess_format(domain, first_name, middle_name, last_name)\n    print(\"ZeroBounce guess format response: \" + response)\nexcept ZBException as e:\n    print(\"ZeroBounce guess format error: \" + str(e))\n```\n\n* ##### Validate an email address\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nemail = \"<EMAIL_ADDRESS>\"   # The email address you want to validate\nip_address = \"127.0.0.1\"    # The IP Address the email signed up from (Optional)\n\ntry:\n    response = zero_bounce.validate(email, ip_address)\n    print(\"ZeroBounce validate response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce validate error: \" + str(e))\n```\n\n* ##### Validate a batch of up to 100 emails at a time\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException, ZBValidateBatchElement\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nemail_batch = [\n    ZBValidateBatchElement(\"valid@example.com\", \"127.0.0.1\"),\n    ZBValidateBatchElement(\"invalid@example.com\"),\n]                   # The batch of emails you want to validate\n\ntry:\n    response = zero_bounce.validate_batch(email_batch)\n    print(\"ZeroBounce validate_batch response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce validate_batch error: \" + str(e))\n```\n\n* ##### The _sendFile_ API allows user to send a file for bulk email validation\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_path = './email_file.csv'  # The csv or txt file\nemail_address_column = 1        # The index of \"email\" column in the file. Index starts at 1\n\nreturn_url = \"https://domain.com/called/after/processing/request\"\n\nfirst_name_column = None        # The index of \"first name\" column in the file\nlast_name_column = None         # The index of \"last name\" column in the file\ngender_column = None            # The index of \"gender\" column in the file\nip_address_column = None        # The index of \"IP address\" column in the file\nhas_header_row = False          # If the first row from the submitted file is a header row\nremove_duplicate = True         # If you want the system to remove duplicate emails\n\ntry:\n    response = zero_bounce.send_file(\n        file_path,\n        email_address_column,\n        return_url,\n        first_name_column,\n        last_name_column,\n        gender_column,\n        ip_address_column,\n        has_header_row,\n        remove_duplicate,\n    )\n    print(\"ZeroBounce send_file response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce send_file error: \" + str(e))\n```\n\n* ##### Check the status of a file uploaded via _sendFile_ method\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_id = \"<FILE_ID>\"       # The returned file ID when calling sendFile API\n\ntry:\n    response = zero_bounce.file_status(file_id)\n    print(\"ZeroBounce file_status response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce file_status error: \" + str(e))\n```\n\n* ##### The _getfile_ API allows users to get the validation results file for the file been submitted using _sendFile_ API\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_id=\"<FILE_ID>\"                         # The returned file ID when calling sendFile API\nlocal_download_path = \"./dwnld_file.csv\"    # The path where the file will be downloaded\n\ntry:\n    response = zero_bounce.get_file(file_id, local_download_path)\n    print(\"ZeroBounce get_file response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce get_file error: \" + str(e))\n```\n\n* ##### Delete the file that was submitted using _sendFile_ API. File can be deleted only when its status is `Complete`\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_id=\"<FILE_ID>\"     # The returned file ID when calling sendFile API\n\ntry:\n    response = zero_bounce.delete_file(file_id)\n    print(\"ZeroBounce delete_file response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce delete_file error: \" + str(e))\n```\n\n### AI Scoring API\n\n* ##### The _scoringSendFile_ API allows user to send a file for bulk email scoring\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_path = './email_file.csv'  # The csv or txt file\nemail_address_column = 1        # The index of \"email\" column in the file. Index starts at 1\n\nreturn_url = \"https://domain.com/called/after/processing/request\"\n\nhas_header_row = False          # If the first row from the submitted file is a header row\nremove_duplicate = True         # If you want the system to remove duplicate emails\n\ntry:\n    response = zero_bounce.scoring_send_file(\n        file_path,\n        email_address_column,\n        return_url,\n        has_header_row,\n        remove_duplicate,\n    )\n    print(\"ZeroBounce send_file response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce send_file error: \" + str(e))\n```\n\n* ##### Check the status of a file uploaded via _scoringSendFile_ method\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_id = \"<FILE_ID>\"       # The returned file ID when calling scoringSendFile API\n\ntry:\n    response = zero_bounce.scoring_file_status(file_id)\n    print(\"ZeroBounce file_status response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce file_status error: \" + str(e))\n```\n\n* ##### The scoring _scoringGetFile_ API allows users to get the validation results file for the file been submitted using scoring _scoringSendFile_ API\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_id=\"<FILE_ID>\"                         # The returned file ID when calling scoringSendFile API\nlocal_download_path = \"./dwnld_file.csv\"    # The path where the file will be downloaded\n\ntry:\n    response = zero_bounce.scoring_get_file(file_id, local_download_path)\n    print(\"ZeroBounce get_file response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce get_file error: \" + str(e))\n```\n\n* ##### Delete the file that was submitted using _scoringSendFile_ API. File can be deleted only when its status is `Complete`\n```python\nfrom zerobouncesdk import ZeroBounce, ZBException\n\nzero_bounce = ZeroBounce(\"<YOUR_API_KEY>\")\n\nfile_id=\"<FILE_ID>\"     # The returned file ID when calling scoringSendFile API\n\ntry:\n    response = zero_bounce.scoring_delete_file(file_id)\n    print(\"ZeroBounce delete_file response: \" + str(response))\nexcept ZBException as e:\n    print(\"ZeroBounce delete_file error: \" + str(e))\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "ZeroBounce India Python API - https://www.zerobounce.in.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/zerobounce/zero-bounce-india-python-sdk-setup"
    },
    "split_keywords": [
        "zero",
        "bounce",
        "india",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2e7baa4b824d0b5cbaebef2ea3683bd1102672dbe79896e7b9bafe014bc1ece",
                "md5": "cfc5cf6f488ea26047ef15a269cfd797",
                "sha256": "39b95ce2d9c1df50adbc0587ea678d709d35e65549c26ddf62eeec7cec61d11b"
            },
            "downloads": -1,
            "filename": "zerobounceindiasdk-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cfc5cf6f488ea26047ef15a269cfd797",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15360,
            "upload_time": "2023-09-12T07:43:44",
            "upload_time_iso_8601": "2023-09-12T07:43:44.021300Z",
            "url": "https://files.pythonhosted.org/packages/d2/e7/baa4b824d0b5cbaebef2ea3683bd1102672dbe79896e7b9bafe014bc1ece/zerobounceindiasdk-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8960c63e3051c523bde7531cfb99a2f79c8e7e5b118d36d2a7ddf55da2af6ec6",
                "md5": "4f2d5264522b39db79340158200f54ff",
                "sha256": "c201180b468681c906a84064bf97694e055a6b4769acea29bee1363dea05a013"
            },
            "downloads": -1,
            "filename": "zerobounceindiasdk-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4f2d5264522b39db79340158200f54ff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9805,
            "upload_time": "2023-09-12T07:43:46",
            "upload_time_iso_8601": "2023-09-12T07:43:46.052020Z",
            "url": "https://files.pythonhosted.org/packages/89/60/c63e3051c523bde7531cfb99a2f79c8e7e5b118d36d2a7ddf55da2af6ec6/zerobounceindiasdk-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-12 07:43:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zerobounce",
    "github_project": "zero-bounce-india-python-sdk-setup",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "zerobounceindiasdk"
}
        
Elapsed time: 0.12140s