Append Hygiene SDK provides a library of classes for working with On-Demand API in your Python code.
Project description
Append Hygiene SDK
Append Hygiene SDK provides a library of classes for working with On-Demand API in your Python code.
Requirements
- Python 3.6+
- Must be logged into the private VPN.
Installation
pip install append-hygiene-sdk
Environment Variables
ONDEMAND_URL
: On-Demand Base URL.
Examples
Hygiene
import time
from dotenv import load_dotenv
from append_hygiene_sdk import Hygiene
load_dotenv()
# Step 1: Create the Hygiene object
my_hygiene = Hygiene()
# Step 2: Add your custom payload to the Hygiene object and execute the hygiene push
my_hygiene.push_hygiene(
payload={
"filepath": "s3://bucket-name/folder1/folder2/file1.csv",
"result_path": "s3://bucket-name/folder1/folder2/",
"verification": False,
"has_header": True,
"email_column_number": 1,
"omit_suppressions": False,
"ignore_duplicates": False,
"suppression_types": [
"trap",
"high_complainer",
"low_complainer"
],
"on_success_uri": "mailto:[EMAIL]?subject=[SUCCESS SUBJECT LINE]",
"on_error_uri": "mailto:[EMAIL]?subject=[FAILED SUBJECT LINE]",
"callback_context": "{\"clientID\": \"123\"}"
}
)
# Step 3: Wait for the hygiene to complete
while my_hygiene.hygiene_status(my_hygiene.hygiene_id):
time.sleep(10)
print("Waiting for Hygiene to complete...")
Append
import time
from dotenv import load_dotenv
from append_hygiene_sdk import Append
load_dotenv()
# Step 1: Create the Append object
my_append = Append()
# Step 2: Add your custom payload to the Append object and execute the Append push
my_append.push_append(
payload={
"filepath": "s3://bucket-name/folder1/folder2/file1.csv",
"has_header": True,
"identifier_columns": {
"first_name": 1,
"last_name": 2,
"address": 4,
"zip5": 8
},
"individual_match": True,
"household_match": False,
"append_fields": [
"email"
],
"hygiene_and_verification": False,
"verification": False,
"results_per_row": 1,
"prioritize_individual_email": True,
"additional_append_fields": {},
"hide_results": False,
"unique_emails": True,
"suppression_types": [
"bad_domain",
"bad_extension",
"bad_word",
"catch_all",
"unsub",
"trap",
"high_complainer",
"low_complainer",
"bad_format",
"invalid",
"unknown",
"unpreferred_domain"
],
"apply_address_correction": False,
"ac_with_history": False,
"append_ac_columns": False,
"raw_email": False,
"result_path": "s3://bucket-name/folder1/folder2/",
"on_success_uri": "mailto:[EMAIL]?subject=[SUCCESS SUBJECT LINE]",
"on_error_uri": "mailto:[EMAIL]?subject=[FAILED SUBJECT LINE]",
"callback_context": "{\"clientID\": \"123\"}"
}
)
# Step 3: Wait for the Append to complete
while my_append.append_status(my_append.append_id):
time.sleep(10)
print("Waiting for Hygiene to complete...")
CHANGELOG
[0.2.1] - 2020-06-01
- Updated package to include Python 3.6+
[0.2.0] - 2020-06-01
- Added
Append
object to the SDK. - Added
push_append
method to the Append class. - Added
append_status
method to the Append class. - Updated
README.md
to include the Append SDK.
[0.1.1] - 2020-06-01
- Updated pypi description
[0.1.0] - 2020-05-31
- Added
Hygiene
object to the SDK. - Added
push_hygiene
method to Hygiene class. - Added
hygiene_status
method to Hygiene class. - Updated
README.md
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
Built Distribution
File details
Details for the file append-hygiene-sdk-0.2.1.tar.gz
.
File metadata
- Download URL: append-hygiene-sdk-0.2.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62d3136a4a64b10c9961b0be9c868b0205e1d0f81c8683e5e05e0d7c5bb4d8f6 |
|
MD5 | d22df510463928fed4b3df4aff8c6009 |
|
BLAKE2b-256 | dbd129d05782a5355f03bfbb078deae8ae9722cdb00dadca99987e6cac2529c9 |
File details
Details for the file append_hygiene_sdk-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: append_hygiene_sdk-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cfdfc86a649483c3f9e5119a8c4b63e7572e6f5c4ced6aa10952a585f51489d |
|
MD5 | 52a0210d25f712ca5ba86ab18e8c88e4 |
|
BLAKE2b-256 | e6d84673792d27e3b451370108f173a1dc618829766ca34126b3af837d041a0a |