ABMeter SDK for feature flags and A/B testing
Project description
ABMeter Python SDK
A simple A/B testing and feature-flag client library for Python applications.
Supported Python versions
abmeter supports Python 3.11 and newer (tested against 3.11, 3.12, 3.13).
Installation
pip install abmeter
Usage
import abmeter
# Configure the client once at startup.
abmeter.configure(api_key="your-api-key")
# Somewhere in the rendering code:
user = abmeter.User(user_id=current_user.id, email=current_user.email)
text = abmeter.resolve_parameter(user, "welcome_text")
# Somewhere in the model code:
abmeter.track_event(
"user_purchases_plan",
current_user.id,
{"plan": purchased_plan.name, "price": purchased_plan.price},
)
resolve_parameter fetches the assignment config from the platform and
resolves the variant client-side (no per-call server round-trip), then
records the exposure in the background. get_exposure evaluates the same
resolution with full detail without submitting, which is useful for
debugging.
What this SDK is
A thin client: it fetches the assignment config, resolves parameters locally, and submits exposures/events. It deliberately does not contain the platform-side concerns of the Ruby gem (config serialization, allocation range-building, type-validation registry). Those live in the ABMeter API.
Development
The package uses uv. It is a pure client library, so the unit suite needs no database or any other running service.
uv sync --extra dev # install dependencies
uv run pytest # tests
uv run ruff check . # lint
uv run mypy # type check
License
Available as open source under the terms of the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abmeter-0.1.0.tar.gz.
File metadata
- Download URL: abmeter-0.1.0.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae45a33da65e67786322b64576b769accb98148bdc295bd600041211fe12f9d1
|
|
| MD5 |
a4d45b8274d687d66e6b11d92a357402
|
|
| BLAKE2b-256 |
7119de210e2febc2bd96e518ea8e89bf623a48fcbd205b2558f765782d20eee6
|
File details
Details for the file abmeter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: abmeter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8deb63e18c0a47b3cfc94fea887f1897f45985950eb68498b00d738950b1a144
|
|
| MD5 |
03c692a8469f8b42ab4ab39fdcb8ac5b
|
|
| BLAKE2b-256 |
7362c3f3b0ba1cf95e7372acc2a1e3876319b5823d92d088364f1587456fb3b5
|