Use this library to integrate your Python app with trak.io. Built and used by UserApp in their trak.io addon.
Install with pip
pip install trakio --pre
import trakio
client=trakio.TrakIOClient("API KEY")
result=client.identify("your_unique_id", {
'email':'[email protected]'
})
TrakIOClient(token, base_address='api.trak.io', version=1, secure=True)
- identify(distinct_id, properties)
- alias(distinct_id, alias)
- annotate(event, properties=None, channel=None)
- track(distinct_id, event, channel=None, properties=None, time=None)
try:
client.track("bob")
except trakio.TrakIOServiceException as e:
print(e.type, e.message, e.details)
except trakio.TrakIOException as e:
print(e)
MIT