Skip to main content
============================
Sift Science Partnership API |TravisCI|_
============================

.. |TravisCI| image:: https://travis-ci.org/SiftScience/sift-partner-python.svg?branch=master
.. _TravisCI: https://travis-ci.org/SiftScience/sift-partner-python

Bindings for Sift Science's `Partnerships API <https://siftscience.com/resources/references/partner-api.html>`_.

Installation
============

Set up a virtual environment with virtualenv (otherwise you will need to make the pip calls as sudo):
::

virtualenv venv
source venv/bin/activate

Get the latest released package from pip:

Python 2:
::

pip install siftpartner

Python 3:
::

pip3 install siftpartner

or install newest source directly from GitHub:

Python 2:
::

pip install git+https://github.com/SiftScience/sift-partner-python

Python 3:
::

pip3 install git+https://github.com/SiftScience/sift-partner-python

Usage
=====

Here's an example:

::

import siftpartner

partner_client = siftpartner.Client(api_key = '<your_rest_api_key_here>',
partner_id = '<your_rest_api_key_here>')

# create a new account for a given merchant
response = partner_client.new_account(
"merchantsite.com", # the url for the merchant's site
"shopowner@merchantsite.com", # an email belonging to the merchant
"johndoe@merchantsite.com", # an email used to log in to Sift
"s0m3l0ngp455w0rd" # password associated with that log in
)


response.is_ok() # returns True of False

print response # prints entire response body and http status code


# Get a list of all merchant accounts created by you
response = partner_client.get_accounts()

response.is_ok() # returns True of False

print response # prints entire response body and http status code

# configure notification endpoint and threshold for you merchants
cfg = {
# set the URL for notifications to arrive at. The %s is replaced by the merchant's customer ID
"http_notification_url": "http://api.partner.com/notify?id=%s",
# Set the threshold to send notifications over. This is the Sift Score/100
"http_notification_threshold": 0.60
}
response = partner_client.update_notification_config(cfg)

response.is_ok() # returns True of False

print response # prints entire response body and http status code

Testing
=======

Before submitting a change, make sure the following commands run without errors from the root dir of the repository:

::

PYTHONPATH=. python tests/client_test.py
PYTHONPATH=. python3 tests/client_test.py


0.0.3 (2016-06-30)
==================
* Added handling of next_ref for get_accounts

0.0.2 (2014-11-06)
==================
* Python REST library for Partnerships API

Metadata

Release files for SiftPartner 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SiftPartner 0.0.3
File Size Uploaded Provenance
SiftPartner-0.0.3.tar.gz 5.7 kB Without provenance Details

Release files / SiftPartner-0.0.3.tar.gz

Download URL SiftPartner-0.0.3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
053f27934309ad8d694d18390aeeae425336980ae210e32957c4386e5727b85f
BLAKE2b-256 checksum
How to use checksums
15adf45ac46e6142850f6cdd8fdd09b2478b4afd1f4095387f8e0c8207cf303e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for SiftPartner 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page