realvalidation

Package Contents

class RealValidation(workbooks=None, token=os.environ.get('RV_TOKEN'), output=DEFAULT_OUTPUT, url=DEFAULT_URL, phone_regex=PHONE_REGEX, staging=False)

RealValidation Application Object

workbooks : list
List of workbook paths to validate against RealValidation DNC API
token : str
RealValidation API Token. Defaults to environmental variable RV_TOKEN
output : str
RealValidation API Output. Defaults to json
url : str
RealValidation API URL. Defaults to https://api.realvalidation.com/rpvWebService/DNCLookup.php
phone_regex : str
Regex to use when validating phone numbers. Defaults to r'^\d{10}$'
staging: bool
If True RealValidation utilizes the Mock API, overrides url parameter
DEFAULT_OUTPUT = json
DEFAULT_URL
PHONE_REGEX = ^\d{10}$
_verify_phone(self, phone)

Verifies a phone using PHONE_REGEX

phone : str
Phone to be verified.
bool
True if successful, otherwise method raises exception (see below)
InvalidPhoneFormatException
If the phone couldn’t be verified using PHONE_REGEX
lookup_phone(self, phone)

Makes a request to the RealValidation DNC API

phone : str
10 numerical digits representing a phone number.
dict
Dictionary representing JSON response from RealValidation DNC API.
lookup_phones_from_workbooks(self)

Validates Workbooks against RealValidation DNC API

dict
Dictionary with values of valid and invalid rows
lookup_phone_from_row(self, row, phone_column_index)

Lookup phone from row at index

row : list
List of strings containing phone
phone_column_index : int
Index/Position of phone in row list
bool
True/False value whether phone is on dnc or not
name = realvalidation