amplitude-experiment
The official Amplitude Experiment Python SDK for server-side instrumentation.
What it is and what it does
The Amplitude Experiment Python SDK is the official server-side library for integrating A/B tests and feature flags into Python applications via Amplitude's Experiment platform. It provides two evaluation modes: remote evaluation, which fetches variant assignments from Amplitude's servers for each user, and local evaluation, which evaluates flags locally after downloading configuration. The SDK handles user context (device ID, user ID, user properties) and returns variant assignments that your code can use to control feature behavior.
The package depends on dataclasses-json for serialization, amplitude_analytics for event tracking integration, and sseclient-py for server-sent event streaming in local evaluation mode. It supports Python 3.6 through 3.10 and is actively maintained. Installation is straightforward with no compiled dependencies, making it suitable for containerized and serverless deployments.
Use it for:
- Run A/B tests on backend logic by fetching variant assignments for users and routing requests accordingly.
- Manage feature flags in production with remote evaluation for real-time control without redeployment.
- Implement local evaluation mode for low-latency flag decisions when network latency to Amplitude is a concern.
- Track experiment exposure and conversion events by integrating flag evaluations with amplitude_analytics.
- Segment users by properties (e.g., premium status) and serve different feature variants based on Amplitude-defined rules.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides server-side A/B testing and feature flag evaluation through Amplitude's Experiment platform, supporting both remote and local evaluation modes.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and is MIT-licensed. It's suitable for production use if you're already using Amplitude for analytics and need server-side experiment or feature flag capabilities. Choose it if you want tight integration with Amplitude's platform; if you need a vendor-agnostic feature flag library, consider alternatives.
Install
amplitude-experiment on PyPI
pip
pip install amplitude-experimentuv
uv add amplitude-experimentpoetry
poetry add amplitude-experimentInstalling amplitude-experiment
Before you install
Low install friction with a pure Python wheel and only three runtime dependencies. Active maintenance with a recent release 28 days ago and ongoing repository activity.
License in practice
MIT License permits commercial and private use with minimal restrictions; suitable for most production deployments.
Quickstart
pip install amplitude-experiment
from amplitude_experiment import Experiment, User
apiKey = 'YOUR-API-KEY'
experiment = Experiment.initialize_remote(apiKey)
user = User(device_id="abcdefg", user_id="user@company.com")
variants = experiment.fetch(user)
variant = variants['YOUR-FLAG-KEY']
Requires a valid Amplitude Experiment API key and network access to Amplitude's remote evaluation service.
Verify before relying
- Whether local evaluation mode requires downloading and updating flag configurations periodically.
- Performance characteristics and latency of remote vs. local evaluation modes under production load.
- Exact retry and timeout behavior when Amplitude's remote service is unavailable.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (<4,>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — dataclasses-json, amplitude_analytics, sseclient-py |
| Maintenance | actively maintained — 28 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 353,340/month — #7,304 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: amplitude_experiment-1.12.0-py3-none-any.whl
Keywords: amplitude, python, backend
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
amplitude-analyticsOfficial Amplitude backend SDK for Python that…
permissive · top 5,000 on PyPI
eppo-server-sdkServer-side feature flagging and…
permissive · top 15,000 on PyPI
growthbookGrowthBook is a feature flagging and A/B…
permissive · top 5,000 on PyPI
optimizely-sdkProvides A/B testing, feature flagging, and…
permissive · top 15,000 on PyPI
openfeature-provider-flagsmithConnects the OpenFeature SDK to Flagsmith for…
unclear · top 15,000 on PyPI
splitio-clientA Python client SDK for integrating Split…
permissive · top 15,000 on PyPI
launchdarkly-server-sdkA server-side SDK for integrating…
permissive · top 5,000 on PyPI
laboratoryLaboratory lets you safely refactor critical…
permissive · top 15,000 on PyPI
statsigStatsig is a Python server SDK for managing…
permissive · top 5,000 on PyPI
flipt-clientA Python client for Flipt feature flag…
permissive · top 15,000 on PyPI