Metadata-Version: 2.4
Name: liftlens
Version: 0.1.0
Summary: An Enterprise-grade A/B Testing Framework with CUPED, SRM, Sequential Testing, FastAPI, Streamlit
License: Apache-2.0
License-File: LICENSE
Keywords: liftlensing,statistics,causal-inference,cuped,sequential-testing
Author: Dare Afolabi
Author-email: dare.afolabi@outlook.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: docs
Provides-Extra: parallel
Requires-Dist: black (>=24.4,<25.0)
Requires-Dist: dask[dataframe] (>=2024.5,<2025.0) ; extra == "parallel"
Requires-Dist: fastapi (>=0.111,<0.112)
Requires-Dist: jinja2 (>=3.1,<4.0)
Requires-Dist: joblib (>=1.4,<2.0)
Requires-Dist: loguru (>=0.7,<0.8)
Requires-Dist: mkdocs (>=1.6,<2.0) ; extra == "docs"
Requires-Dist: mkdocs-material (>=9.5,<10.0) ; extra == "docs"
Requires-Dist: mkdocstrings[python] (>=0.25,<0.26) ; extra == "docs"
Requires-Dist: mypy (>=1.10,<2.0)
Requires-Dist: numpy (>=1.26,<2.0)
Requires-Dist: pandas (>=2.2,<3.0)
Requires-Dist: pandera (>=0.19,<0.20)
Requires-Dist: plotly (>=5.21,<6.0)
Requires-Dist: psycopg2-binary (>=2.9,<3.0)
Requires-Dist: pyarrow (>=16.0,<17.0)
Requires-Dist: pydantic (>=2.7,<3.0)
Requires-Dist: pydantic-settings (>=2.3,<3.0)
Requires-Dist: pytest (>=8.2,<9.0)
Requires-Dist: pytest-cov (>=5.0,<6.0)
Requires-Dist: python-dotenv (>=1.0,<2.0)
Requires-Dist: ray[default] (>=2.21,<3.0) ; extra == "parallel"
Requires-Dist: retrying (>=1.3,<2.0)
Requires-Dist: ruff (==0.14.2)
Requires-Dist: scipy (>=1.13,<2.0)
Requires-Dist: sqlalchemy (>=2.0,<3.0)
Requires-Dist: statsmodels (>=0.14,<0.15)
Requires-Dist: streamlit (>=1.34,<2.0)
Requires-Dist: typer[all] (>=0.12,<0.13)
Requires-Dist: uvicorn[standard] (>=0.29,<0.30)
Requires-Dist: weasyprint (>=62.1,<63.0)
Project-URL: Homepage, https://github.com/dare-afolabi/liftlens
Project-URL: Repository, https://github.com/dare-afolabi/liftlens
Description-Content-Type: text/markdown

![liftlens logo](assets/logo.jpeg)

<div align="center">
  <a href="https://github.com/dare-afolabi/liftlens/actions/workflows/ci.yml">
    <img src="https://img.shields.io/github/actions/workflow/status/dare-afolabi/liftlens/ci.yml?branch=main&style=flat" alt="Build Status">
  </a>
  <a href="https://codecov.io/gh/dare-afolabi/liftlens">
    <img src="https://img.shields.io/codecov/c/github/dare-afolabi/liftlens?style=flat" alt="Coverage">
  </a>
  <a href="https://pypi.org/project/liftlens/">
    <img src="https://img.shields.io/pypi/v/liftlens?style=flat" alt="PyPI Version">
  </a>
  <a href="https://github.com/dare-afolabi/liftlens/blob/main/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue?style=flat" alt="License">
  </a>
  <a href="https://pypi.org/project/liftlens/">
    <img src="https://img.shields.io/pypi/dm/liftlens?style=flat" alt="Downloads">
  </a>
  <a href="https://github.com/sponsors/dare-afolabi">
    <img src="https://img.shields.io/badge/Sponsor-lightgrey?style=flat&logo=github-sponsors" alt="Sponsor">
  </a>
</div>

# liftlens

Confirm the lift before you launch using **liftlens**, an **enterprise-grade A/B testing platform** with:

- **CUPED**, **SRM detection**, **sequential testing (OBF/Pocock)**
- **Heterogeneous treatment effects** (Causal Forest, S/X/T-Learner)
- **FastAPI + JWT auth**, **Streamlit dashboard**
- **Parallel execution** (Joblib/Dask/Ray)
- **Interactive HTML/PDF reports** with Plotly
- **SQLite experiment registry**
- **95%+ test coverage**, **CI/CD ready**

---

## Quick Start

```bash
# 1. Clone & install
git clone https://github.com/dare-afolabi/liftlens.git
cd liftlens
poetry install --with dev,docs

# 2. Generate synthetic data
poetry run generate-synthetic --n_users 10000 --output data/synthetic.csv

# 3. Run experiment
poetry run liftlens run \
  --config examples/revenue_test.yaml \
  --output output/run_1

# 4. Launch API + Dashboard
docker-compose up
```

- **API:** `http://localhost:8000/docs`
- **Dashboard:** `http://localhost:8501`
- **Report:** `output/run_1/report.html`

---

## Configuration (YAML)

```yaml
# examples/revenue_test.yaml
name: Revenue Lift Test
data:
  type: csv
  path: data/synthetic.csv
baseline_col: baseline
outcome_col: outcome
group_col: group
metrics:
  - name: revenue_lift
    func: mean_diff
  - name: arpu
    func: ratio_metric
    params:
      denominator_col: active_users
transform:
  winsorize: [0.01, 0.01]
  cuped: true
  log_transform: true
stats:
  sequential: true
  method: obf
```

---

## Features

- CUPED Variance Reduction
- SRM Detection (Chi²)
- Sequential Testing (OBF/Pocock)
- Bootstrap + Permutation Tests
- Multiple Comparison Corrections
- Heterogeneous Treatment Effects
- ANCOVA, Mixed Effects, GAM
- FastAPI + API Key Auth
- Streamlit Dashboard
- HTML/PDF Reports (Jinja2 + WeasyPrint)
- Parallel Processing
- SQLite Registry
- Docker Compose

---

## Project Structure

```bash
liftlens/
├── core/           # Session, registry
├── config/         # Pydantic schemas
├── data/           # IO, validation, transforms
├── metrics/        # Primary, robust, composite
├── stats/          # Inference, power, sequential, HTE
├── viz/            # Plotly: dist, effects, diagnostics
├── report/         # Jinja2 templates + builder
├── workflows/      # Pipeline, presets
├── engine/         # Parallel execution
├── api/            # FastAPI, Streamlit, auth
├── utils/          # Logging, decorators
└── cli.py          # Typer CLI
```

---

## Development

```bash
# Install pre-commit
poetry run pre-commit install

# Run tests
poetry run pytest -m "not slow"

# Lint & format
poetry run ruff check .
poetry run black .

# Build docs
poetry run mkdocs serve
```

---

## License

Apache 2.0



