Metadata-Version: 2.4
Name: abmeter
Version: 0.1.0
Summary: ABMeter SDK for feature flags and A/B testing
Project-URL: Homepage, https://github.com/abmeter/abmeter-python
Project-URL: Source, https://github.com/abmeter/abmeter-python
Author-email: ABMeter <info@abmeter.com>
License: MIT License
        
        Copyright (c) 2026 ABMeter
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE. 
License-File: LICENSE.txt
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# 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

```bash
pip install abmeter
```

## Usage

```python
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](https://docs.astral.sh/uv/). It is a pure client library,
so the unit suite needs no database or any other running service.

```bash
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](https://opensource.org/licenses/MIT).
