Python SDK for querying Versium Reach APIs
Project description
Versium Reach API Software Development Kit (SDK)
A simplified Python interface for appending data using Versium Reach APIs
Installation
It's recommended that you first create a virtual Python environment before installing using tools such as virtualenv or conda. This is to prevent you from installing the package directly onto your system's base Python installation. Once you have created and activated your virtual environment, proceed with one of the steps below.
PyPI
pip install versium-reach-sdk
Install from Source
- Clone or download the codebase from the GitHub Page
- CD into the newly downloaded or cloned folder
cd reach-path-python-sdk
- Now install the package with pip
pip install .
Usage
- Import ReachClient into your program
from reach import ReachClient
- Pass your API Key to the ReachClient constructor.
client = ReachClient('path-key-012345678')
- Run the
append
method of yourReachClient
object with the API name, input records, desired outputs (if applicable), and any extra config parameters you wish to pass.
records = [{"first": "John",
"last": "Smith",
"address": "123 Main St.",
"city": "New York",
"state": "NY"}]
results = client.append(api_name="contact",
input_records=records,
outputs=["phone", "email"],
config_params={"match_type": "indiv"})
Returned Results
Results are returned as a list of QueryResult objects, which contain the following attributes:
-
body : The parsed body of the response from the Versium Reach API.
-
success : Indicates whether the request returned with a successful status code.
-
match_found : Indicates whether a match was found for the queried record
-
http_status : The http status code for the response.
-
reason: Explanation of the http status code (e.g. 200 => "OK", 404 => "Not Found", 401 => "Unauthorized", etc.)
-
headers: The headers of the response.
-
body_raw: The body of the response as raw bytes
-
request_error: If the client errored out during a request, this stores the error object
Things to keep in mind
- The default rate limit for Reach APIs is 20 queries per second
- You must have a provisioned API key for this function to work. If you are unsure where to find your API key, look at our API key documentation
Project details
Release history Release notifications | RSS feed
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
Hashes for versium_reach_sdk-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a956ee4effbd00e2aad5cbc9247512109155b3d681c5a330270a45ae5d731cf9 |
|
MD5 | 95c18194a9f4e294f7ac6c518160a759 |
|
BLAKE2b-256 | 111529b0bb99609b20a5637a22bf8d2f1a6d30d3adc63c7c9a613a94bd38e258 |