Skip to main content

Python SDK to integrate with Suprsend Platform

Project description

suprsend-py-sdk

This package can be included in a python3 project to easily integrate with Suprsend platform.

We're working towards creating SDK in other languages as well.

Suprsend SDKs available in following languages

  • python3 >= 3.7 (suprsend-py-sdk)

Installation

suprsend-py-sdk is available on PyPI. You can install using pip.

$ pip install suprsend-py-sdk

Usage

Initialize the Suprsend SDK

from suprsend import Suprsend
# Initialize SDK
supr_client = Suprsend("env_key", "env_secret")

Following example shows a sample request for triggering a workflow. It triggers a notification to a user with id: distinct_id, email: user@example.com & androidpush-token: __android_push_token__ using template purchase-made and notification_category system

# Prepare Workflow body
workflow_body = {
    "name": "Purchase Workflow",
    "template": "purchase-made",
    "notification_category": "system",
    "delay": "15m",
    "users": [
        {
            "distinct_id": "0f988f74-6982-41c5-8752-facb6911fb08",
            "$email": ["user@example.com"],
            "$androidpush": ["__android_push_token__"],
        }
    ],
    "data": {
        "template": {
            "first_name": "User",
            "spend_amount": "$10"
        }
    }
}

# Trigger workflow
supr_client.trigger_workflow(workflow_body)

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

suprsend-py-sdk-0.0.9.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

suprsend_py_sdk-0.0.9-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file suprsend-py-sdk-0.0.9.tar.gz.

File metadata

  • Download URL: suprsend-py-sdk-0.0.9.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for suprsend-py-sdk-0.0.9.tar.gz
Algorithm Hash digest
SHA256 35e905981b60541687cdfa21887dddbd82662f40d7f3ac952aef4d4e16c574f2
MD5 e5a46bfef3e9351f99958a74991407c3
BLAKE2b-256 fdd01e42c0135d4d93cdce63a116e37669d370cad4b292c888c0a1a84e003e0a

See more details on using hashes here.

File details

Details for the file suprsend_py_sdk-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: suprsend_py_sdk-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for suprsend_py_sdk-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cdc7dd39b1e16a7dbd94f7385efead160ff3dd314725c60b16048224cf8ddbbb
MD5 470ddf03d5a0e4d81fe6e4521ebcbf15
BLAKE2b-256 26488ac7ceef219342e6fd1099656985d6b16382042cdfcd8342197f3cff943a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page