mixpanel
Official Mixpanel library for Python
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 mixpaneluv
uv add mixpanelpoetry
poetry add mixpanelInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
mixpanel-py-asyncProvides asynchronous event batching and…
permissive · top 15,000 on PyPI
segment-analytics-pythonA Python client for sending analytics events to…
permissive · top 5,000 on PyPI
chargebeeOfficial Python client library for integrating…
unclear · top 5,000 on PyPI
amplitude-analyticsOfficial Amplitude backend SDK for Python that…
permissive · top 5,000 on PyPI
analytics-pythonA Python client library that sends analytics…
permissive · top 5,000 on PyPI
shotgun-api3Official Python API client for Autodesk Flow…
unclear · top 15,000 on PyPI
posthogPostHog Python SDK integrates product analytics…
permissive · top 1,000 on PyPI
auth0-pythonProvides Python bindings to Auth0's…
permissive · top 5,000 on PyPI
kanaries-trackSends event and metric data to Kanaries' data…
permissive · top 15,000 on PyPI
oai-statsig-python-coreStatsig Python bindings for server-side feature…
permissive · top 15,000 on PyPI