skillfed

mixpanel

Official Mixpanel library for Python

mixpanel v5.3.0 8.0M downloads/30d#1,679 on PyPI108
Permissive license Apache-2.0 Active released

What it is and what it does

Mixpanel is the official Python client for sending analytics events and user profile data to Mixpanel's servers. It provides a straightforward API for tracking user actions (events) and updating user properties (people profiles) from your Python backend, along with support for feature flag evaluation. The library handles HTTP communication via requests or httpx, validates data structures with pydantic, and supports both simple token-based authentication and more secure service account credentials for server-to-server integrations.

Typical workflows involve creating a Mixpanel instance with your project token, then calling track() to log user events with custom properties and people_set() to update user profile attributes. For enhanced security, you can configure service account credentials for authentication on protected operations. The library also supports custom consumers like BufferedConsumer for batching events before sending, and integrates with asgiref for ASGI compatibility.

Use it for:

  • Track user interactions (clicks, form submissions, page views) from a Python web backend to build user behavior analytics.
  • Update user profile properties (name, email, subscription tier) in Mixpanel whenever user data changes in your application.
  • Evaluate feature flags server-side using service account credentials to control feature rollouts and A/B tests.
  • Batch and buffer events using custom consumers to reduce network overhead in high-traffic applications.
  • Integrate analytics into Python web applications for automatic event collection and user profiling.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Official Python library for server-side Mixpanel integration, enabling event tracking, user profile updates, and feature flag evaluation.

Yes. This is the official Mixpanel Python library with active maintenance, low install friction, permissive licensing, and no known vulnerabilities. It supports Python 3.9–3.13 and provides both simple and secure authentication patterns. Install it if you need server-side Mixpanel integration; the API is straightforward and the dependency footprint is reasonable.

Install

mixpanel on PyPI

pip

pip install mixpanel

uv

uv add mixpanel

poetry

poetry add mixpanel

Installing mixpanel

Before you install

Low friction installation with a pure-wheel distribution. Active maintenance with a recent release (18 days old) and steady commit activity. Depends on common, well-maintained libraries: requests, httpx, pydantic, asgiref, and json-logic.

License in practice

Licensed under Apache-2.0 (permissive), allowing use in commercial and private projects with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

pip install mixpanel

from mixpanel import Mixpanel

mp = Mixpanel('YOUR_TOKEN')
mp.track('user_id', 'button clicked', {'color': 'blue', 'size': 'large'})
mp.people_set('user_id', {'$first_name': 'John'})

Requires Python 3.9 or later. Mixpanel token must be obtained from your Mixpanel project.

Verify before relying

  • Whether buffering and batching behavior is suitable for high-volume event scenarios without additional tuning.
  • Performance characteristics when using service account credentials versus token-based authentication.
  • Retry and failure-handling semantics for network errors or rate limiting.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — requests, httpx, pydantic, asgiref, json-logic
Maintenance actively maintained — 18 days since the last release
Last repo commit
First released
Downloads 7,956,832/month — #1,679 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mixpanel-5.3.0-py3-none-any.whl

Keywords: mixpanel, analytics

Operating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

mixpanel event tracking pythonserver-side analytics libraryuser profile updates mixpanelfeature flags python sdkmixpanel service account authanalytics data collection pythonmixpanel api client
analyticsevent-trackingservice-account-auth

More WWW/HTTP packages