analytics-python
The hassle-free way to integrate analytics into any python application.
What it is and what it does
analytics-python is the official Python client for Segment's analytics platform. It wraps the Segment REST API to let you send user events and properties from your Python application to Segment, which then routes that data to your choice of downstream analytics services—Mixpanel, Google Analytics, Amplitude, or dozens of others—without requiring you to integrate each service separately.
The library handles the HTTP communication through requests, manages retries via backoff, and provides a straightforward API for tracking events, identifying users, and recording page views. It depends on six runtime packages including python-dateutil for timestamp handling and monotonic for consistent timing. The package is permissively licensed under MIT and has low installation friction.
Use it for:
- Track user interactions (clicks, form submissions, purchases) in a web or mobile backend and send them to Segment for aggregation across analytics platforms
- Identify and profile users with custom properties, then sync that data to CRM or marketing automation tools via Segment's integrations
- Collect server-side events from a Python application and route them to multiple analytics destinations without maintaining separate client libraries
- Log application events for real-time dashboarding and historical analysis across tools like Mixpanel, Amplitude, or custom data warehouses
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client library that sends analytics events to the Segment API, allowing you to track user actions and integrate with multiple downstream analytics services through a single interface.
Yes, if you use Segment for analytics aggregation. The package is stable, permissively licensed, and has low install friction. However, note that the description itself directs users to the newer listing at segment-analytics-python due to a naming conflict, so verify whether you should use that package instead before installing this one.
Install
analytics-python on PyPI
pip
pip install analytics-pythonuv
uv add analytics-pythonpoetry
poetry add analytics-pythonInstalling analytics-python
Before you install
Low install friction with five straightforward runtime dependencies. The package is actively maintained with recent commits and has been stable since its initial 2013 release, though the latest release was in March 2023.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install analytics-python
import analytics
analytics.write_key = 'YOUR_WRITE_KEY'
analytics.track('user_id', 'event_name', {'property': 'value'})
Verify before relying
- Whether the package continues to receive updates beyond March 2023 despite active repo status
- Compatibility with Python versions beyond 3.8 given classifier list ends there
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — requests, six, monotonic, backoff, python-dateutil |
| Maintenance | actively maintained — 1,241 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,753,077/month — #3,591 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: analytics_python-1.4.post1-py2.py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
segment-analytics-pythonA Python client for sending analytics events to…
permissive · top 5,000 on PyPI
universal-analytics-python3Sends event and pageview data to Google…
permissive · top 15,000 on PyPI
launchpadliblaunchpadlib provides a Python client library…
copyleft · top 15,000 on PyPI
posthoganalyticsSends event data and user properties to PostHog…
permissive · top 5,000 on PyPI
amplitude-analyticsOfficial Amplitude backend SDK for Python that…
permissive · top 5,000 on PyPI
kanaries-trackSends event and metric data to Kanaries' data…
permissive · top 15,000 on PyPI
apache-airflow-providers-segmentIntegrates Apache Airflow with Segment for…
permissive · top 15,000 on PyPI
posthogPostHog Python SDK integrates product analytics…
permissive · top 1,000 on PyPI
snowplow-trackerSends event data from Python applications to…
permissive · top 1,000 on PyPI
mixpanel-py-asyncProvides asynchronous event batching and…
permissive · top 15,000 on PyPI