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.3.tar.gz
(20.0 kB
view details)
Built Distribution
File details
Details for the file events-sdk-python-0.0.3.tar.gz
.
File metadata
- Download URL: events-sdk-python-0.0.3.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d4a5dcdf1e50a6a7d9e6ef42b4b3bc6781d0a222806f08617b5da0bb87a9e7 |
|
MD5 | a25d9aafa1f8af4f85f7029a4e608a44 |
|
BLAKE2b-256 | e6aa44c27b4ea5ff8cf81c4e1919086e526891b284a0a9e901cba109cd1333f6 |
File details
Details for the file events_sdk_python-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: events_sdk_python-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9166b161e91892fc95c8111ead19d36beea6e4e177aeb3fb5bbe28b98eeab8b |
|
MD5 | 619b72b47f137b011e6035ee353e530a |
|
BLAKE2b-256 | e514d2abce37d7b0e8028351de3019f219406f8425a227846b2c168a96d395a1 |