Skip to content

Repository files navigation

totango-python

PyPI Version PyPI License Python Versions CI codecov

Python client for Totango's HTTP tracking pixel API.

Requirements

  • Python 3.10+
  • requests

Installation

pip install totango

From source:

git clone [email protected]:gbourdin/totango-python.git
cd totango-python
pip install -e .

Quick Usage

import totango

tt = totango.Totango("SP-XXXX-XX", user_id="user-123")
tt.track("module", "action")

Usage

import totango

tt = totango.Totango(
    "SP-XXXX-XX",
    user_id="user-123",
    user_name="Jane User",
    account_id="acct-1",
    account_name="Acme Inc",
)

# Track an activity event
tt.track("dashboard", "opened", user_opts={"plan": "gold"})

# Send an identify-style update without activity module/action
tt.send(account_opts={"tier": "enterprise"})

Development

Run the default test suite:

python -m unittest discover -s tests -v

Run lint and type checks:

ruff check .
ty check .

Run the multi-version matrix with tox (3.10 through 3.15):

tox -e py310,py311,py312,py313,py314,py315
tox -e lint,type

Continuous integration also runs this matrix in GitHub Actions on each push and pull request.

About

Totango Python lib

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages