/jitsu-python-example

Analytics for your python lib based on Jitsu example

Primary LanguagePython

Overview

This project demostrates how Jitsu can be used to track anonymous usage events (aka Telemetry) for pip package. Basic os info (version, platform it's) is being sent through Jitsu.API. On backend the data is enriched with location (Country, City) and other usefull parameters.

How it works

Please note, that this repository is not a python package itself, but a demostration how Jitsu can work as a Telemetry backend. Just copy the code to enable telemetry collection in your package.

The code sends two types of events:

  • install — when pip package is installed (via setup.py)
  • module_init — when module is initialized, see __init__.py

See the underlying code in telemetry.py

Prerequisites

  1. telemetry.py is using Jitsu as a backend: Deploy Jitsu or signup for Jitsu.Cloud
  2. Create an API Key and a Destination (for Cloud.Jitsu users we offer free demo Postgres destination) in Jitsu UI.
  3. Put HTTP calls into telemetry.py

Disabling Telemetry

This example allows to opt-out for tracking by setting TELEMETRY_DISABLED to true.

About Jitsu

Jitsu is an open-source data collection platform.