Events SDK Python for Hightouch event collection.
Project description
Events SDK Python
Installation
Install events-sdk-python
using pip:
python -m pip install events-sdk-python
Usage
By default, you do not need to manually instantiate the client. Simply set your key and start calling methods.
import hightouch.htevents as htevents
htevents.write_key = 'YOUR_WRITE_KEY'
htevents.identify('userId1', {
'email': 'bat@example.com',
'name': 'Person People',
})
htevents.track('userId1', 'Order Completed', {})
Note If you need to send data to multiple Hightouch sources, you can initialize one new Client per write_key
.
from hightouch.htevents.client import Client
htevents.write_key = 'YOUR_WRITE_KEY'
other_htevents = Client('<OTHER_WRITE_KEY>')
htevents.identify('userId1', {
'email': 'bat@example.com',
'name': 'Person People',
})
other_htevents.identify('userId1', {
'email': 'bat@example.com',
'name': 'Person People',
})
htevents.track('userId1', 'Order Completed', {})
other_htevents.track('userId1', 'Order Completed', {})
Note Only instantiate Client
class once per write key, per application.
from flask import Flask
from hightouch.htevents.client import Client
app = Flask(__name__)
// For example, in flask, instantiate the client outside of the request handlers
htevents = Client('<WRITE_KEY>')
@app.route('/')
def hello_world():
htevents.track('userId1', 'hello', {})
return 'Hello World'
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
events-sdk-python-0.0.2.tar.gz
(20.0 kB
view hashes)
Built Distribution
Close
Hashes for events_sdk_python-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c2895a7f713089283aeabd02babe52b7eb11b21e8b6ce9d1a8e700d3df0ad14 |
|
MD5 | d4d653795858f08a8cdfe74b2a635537 |
|
BLAKE2b-256 | 33990d9c8bee88d4cf1af5f398cc3cc8897f11bd8dde02e80028aade740d709b |