Learn more about the Vemetric Python SDK in the official docs.
You can also checkout the package on PyPI.
pip install vemetricfrom vemetric import VemetricClient
vemetricClient = VemetricClient(token="YOUR_PROJECT_TOKEN")
vemetricClient.track_event(
"SignupCompleted",
user_identifier="user-id",
user_display_name="John Doe",
event_data={"key": "value"},
)
vemetricClient.update_user(
"user-id",
user_data={
"set": {"key1": "value1"},
"setOnce": {"key2": "value2"},
"unset": ["key3"]
},
)The client can be configured with the following options:
vemetricClient = VemetricClient(
token="YOUR_PROJECT_TOKEN", # Required
host="https://hub.vemetric.com", # Optional, defaults to https://hub.vemetric.com
timeout=2.0, # Optional, default to 2 seconds
session=requests.Session(), # Optional, defaults to None, creating a new one
)