skillfed

amplitude-experiment

The official Amplitude Experiment Python SDK for server-side instrumentation.

amplitude-experiment v1.12.0 353.3K downloads/30d#7,304 on PyPI4
Permissive license MIT License Active released

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-experiment

uv

uv add amplitude-experiment

poetry

poetry add amplitude-experiment

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

amplitude experiment sdka/b testing python serverfeature flags evaluationremote feature flag evaluationexperiment variant lookupserver-side feature flagsamplitude analytics integration
feature-flagsa-b-testingamplitude

More Software Development packages