Metadata-Version: 2.5
Name: trevosdk
Version: 0.1.0
Summary: Trevo server SDK for Python — deterministic variant assignment and event tracking
Project-URL: Homepage, https://trevosdk.com
Project-URL: Documentation, https://docs.trevosdk.com
License-Expression: MIT
Keywords: ab-testing,analytics,experimentation,feature-flags,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: mypy>=1.14; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.9; extra == 'dev'
Description-Content-Type: text/markdown

# trevosdk

Trevo server SDK for Python — deterministic variant assignment and event tracking
for [Trevo](https://trevosdk.com) experiments. Zero dependencies; Python 3.10+.

```sh
pip install trevosdk
```

```python
from trevosdk import TrevoClient

trevo = TrevoClient("tsk_secret_...")

variant = trevo.get_variant("checkout-cta", user_id="user-42")
if variant == "treatment":
    ...  # alternate experience

trevo.track("checkout_started", user_id="user-42", properties={"plan": "pro"})
```

`get_variant` reads an immutable in-memory config snapshot — no network call, safe
from Django/Flask views, FastAPI handlers, Celery tasks, and scripts alike. Config
refresh and event delivery run on background threads; events flush on interpreter
exit, or deterministically via `trevo.flush()` / `trevo.close()`.

Assignment is byte-identical to every other Trevo SDK: the same user gets the same
variant in the browser and on the backend, verified against the shared conformance
corpus.

For strict-async apps, `AsyncTrevoClient` wraps the same client with an awaitable
lifecycle (`async with`, `await flush()`) — no extra dependencies.

Full docs at [docs.trevosdk.com](https://docs.trevosdk.com).
