2025-11-15 12:44:50 +00:00
2026-03-05 22:09:29 +00:00
2025-01-02 12:52:51 -05:00
2020-02-09 21:11:22 -08:00
2025-04-10 15:30:54 +01:00
2020-02-09 21:11:22 -08:00

Hanzo Insights Python SDK

Integrate Hanzo Insights into any Python application.

Installation

pip install hanzo-insights

Quick Start

from hanzo_insights import Insights

client = Insights('<your_project_api_key>', host='https://insights.hanzo.ai')

# Capture an event
client.capture('user_123', 'purchase', properties={'product': 'widget'})

# Feature flags
if client.feature_enabled('new-checkout', 'user_123'):
    show_new_checkout()

Module-level usage

import hanzo_insights

hanzo_insights.api_key = '<your_project_api_key>'
hanzo_insights.host = 'https://insights.hanzo.ai'

hanzo_insights.capture('movie_played', distinct_id='user_123', properties={'movie_id': '42'})
hanzo_insights.shutdown()

Python Version Support

SDK Version Python Versions Supported
7.3.1+ 3.10, 3.11, 3.12, 3.13, 3.14
7.0.0 - 7.0.1 3.10, 3.11, 3.12, 3.13
4.0.1 - 6.x 3.9, 3.10, 3.11, 3.12, 3.13

Development

We use uv.

uv python install 3.12
uv python pin 3.12
uv venv
source env/bin/activate
uv sync --extra dev --extra test
pre-commit install
make test

Running Tests

make test
# or run a specific test:
pytest -k test_no_api_key

License

MIT

S
Description
Hanzo tenant service — sourced from hanzoai/insights-python
Readme MIT
3.2 MiB
Languages
Python 99.6%
Makefile 0.2%
Shell 0.1%