Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

increment

CI PyPI Python License

A/B testing that shows its work.

Increment is an open-source Python library for analyzing A/B tests. Give it a dataframe or a SQL warehouse; it returns each metric's effect with a confidence interval, and says plainly when the data cannot support a conclusion.

Released documentation · Released quickstart · Examples · Website

Install

The examples below use the repository API (from_frame, from_definitions, and run) from the pinned source revision. The latest published PyPI release, 0.1.0a2, has a different API; its Analysis examples are not interchangeable with this README. For the release's API, see its 0.1.0a2 package documentation. For the API shown here, install the matching source:

python -m pip install "increment @ git+https://github.com/kylejcaron/increment.git@0381d0f5725228a45288125493abc2e1714d65f6" polars

The archived guides below contain outdated unversioned install commands. Keep this README's pinned source routes, including the demo extra below.

Quickstart examples at this revision · data model · metric types

Increment needs Python 3.12 or newer. It reads pandas, Polars and PyArrow dataframes; this example uses Polars.

Quickstart

Start with one row per user: the variant they saw and what they did.

from random import Random

import polars as pl

from increment import from_frame, run

# Simulated data: treatment raises revenue and conversion by 8%.
rng = Random(7)
n = 2_000
variant = ["treatment" if rng.random() < 0.5 else "control" for _ in range(n)]
lift = [1.08 if v == "treatment" else 1.0 for v in variant]
df = pl.DataFrame(
    {
        "user_id": range(n),
        "variant": variant,
        "revenue": [rng.expovariate(1 / 10) * x for x in lift],
        "converted": [rng.random() < 0.10 * x for x in lift],
    }
)

experiment, reader = from_frame(
    df,
    shape="summary",
    unit="user_id",
    group="variant",
    control="control",
    metrics=["revenue", "converted"],
)
result = run(experiment, reader)
print(result.readout())

For an HTML table in a notebook, add the tables extra to the source install:

python -m pip install "increment[tables] @ git+https://github.com/kylejcaron/increment.git@0381d0f5725228a45288125493abc2e1714d65f6"
from increment.tables import readout_table

readout_table(result, title="Revenue and conversion")

Revenue rose 10.7%, with a 95% confidence interval of 1.5% to 20.7%. The conversion result is inconclusive: its interval, −39.9% to +29.3%, includes zero. Two thousand users are too few to detect an 8% change in a 10% conversion rate; power analysis tells you how many you need.

  • from_frame describes the experiment: the column that identifies users (unit), the column that holds the variant (group), the control variant, and the metrics. shape="summary" means one row per user; use shape="panel" for one row per user per day; include every assigned unit at least once with its assignment and exposure date (sparse-panel preparation).
  • Each metric's type comes from its column: floating-point numbers use mean, and Boolean columns use conversion. A floating-point 0/1 outcome still uses mean; if a cast can change a Boolean to float, declare the intended type explicitly before inspecting results, for example metrics={"converted": "conversion"}. Integer columns also need an explicit type because they may represent either a count or a binary outcome.
  • from_frame also returns a reader, which reads your data when run needs it. run(experiment, reader) analyzes the experiment. result.readout() lists the estimates; result.to_frame() returns them as a dataframe.
  • The closing lines name checks that did not run. Here, Increment could not test for a sample ratio mismatch (SRM: a traffic split different from the plan) because the example did not state the planned split.

Next: declare the split, a primary metric and guardrails · reduce variance with CUPED · monitor while the test runs · read every result field

Analyze data in your warehouse

Describe your tables, metrics and experiments once in YAML, then run the analysis inside your warehouse through Ibis. Install the warehouse extra from the same pinned source, plus the Ibis backend you use:

python -m pip install "increment[warehouse] @ git+https://github.com/kylejcaron/increment.git@0381d0f5725228a45288125493abc2e1714d65f6" "ibis-framework[snowflake]"
import ibis
from increment import from_definitions, run

con = ibis.snowflake.connect(...)
experiment, reader = from_definitions("definitions/", con, experiment_name="checkout_redesign")
with reader:
    result = run(experiment, reader)
print(result.readout())

Any Ibis SQL backend is supported. DuckDB, PostgreSQL, Snowflake, and BigQuery are verified by execution test suites; other backends show a one-time UnverifiedWarehouseWarning. An analysis runs when Ibis can translate its queries for that backend, and stops with query.backend.operation_unsupported when it cannot. The default captured run needs TEMP tables. Scalar warehouse CUPED can use coherence="live"; multicovariate CUPED fitting and categorical-cell acquisition need TEMP tables. Unit-day artifacts need a verified backend. The data-model guide explains the YAML and other warehouses, and the warehouse example is a notebook that runs the whole workflow on a local DuckDB database.

What else it does

  • Plan: sample size, power and minimum detectable effect.
  • Reduce variance: CUPED with pre-experiment data.
  • Monitor: sequential tests that stay valid when you look at results repeatedly.
  • Correct for many comparisons across metrics and segments.
  • Use priors: Bayesian estimates and the probability that a variant is better.
  • Break results down by segment or by day.
  • Analyze other designs: switchback, encouragement and observational (IPTW, AIPW, DML) studies.
  • Report: readout tables, and an HTML dashboard for warehouse experiments.

The method guide helps you choose; the compatibility matrix lists which methods combine.

Optional extras

These extras are for the pinned source revision used by this README, not an unpinned PyPI release:

Pinned-source install Adds
increment[warehouse] @ git+https://github.com/kylejcaron/increment.git@0381d0f5725228a45288125493abc2e1714d65f6 Ibis and SQLGlot for SQL warehouses; add your warehouse's Ibis backend
increment[demo] @ git+https://github.com/kylejcaron/increment.git@0381d0f5725228a45288125493abc2e1714d65f6 Warehouse support and DuckDB, for local examples
increment[tables] @ git+https://github.com/kylejcaron/increment.git@0381d0f5725228a45288125493abc2e1714d65f6 Formatted readout tables (CoefTable and pandas)
increment[dashboard] @ git+https://github.com/kylejcaron/increment.git@0381d0f5725228a45288125493abc2e1714d65f6 An HTML experiment dashboard (marimo, anywidget, CoefTable and pandas)

Before you rely on a result

When a request is not supported, Increment stops with an error code that names a fix. When one estimate cannot be computed, it is reported as unavailable, with the reason, instead of being dropped. Methods carry assumptions: read the statistical limitations and the validation evidence.

Increment analyzes data you already have. It does not assign traffic, run feature flags, or store events.

Contributing and license

See CONTRIBUTING.md. Contributions require a signed Contributor License Agreement.

Apache License 2.0. See LICENSE and NOTICE. Copyright 2026 Kyle Caron.

Metadata

Release files for increment 0.1.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for increment 0.1.0a3
File Size Uploaded Provenance Actions
increment-0.1.0a3.tar.gz 2.0 MB With provenance Details for increment-0.1.0a3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for increment 0.1.0a3
File Interpreter ABI Platform Actions
increment-0.1.0a3-py3-none-any.whl Python 3 none any Details for increment-0.1.0a3-py3-none-any.whl

Total release size: 4.2 MB

Release files / increment-0.1.0a3.tar.gz

Download URL increment-0.1.0a3.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
dc467a3c81e2d5ec632dbc740e378062c09bbb0660811411f13edd670aad9fed
BLAKE2b-256 checksum
How to use checksums
3d7b55730221de17b7805928f3097acc0b78d5f3fe5aa6c57c8727f25db39b61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / increment-0.1.0a3-py3-none-any.whl

Download URL increment-0.1.0a3-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
957e65a9e74e2c523efe79e9ba5b818aabb7c2d738ca8bdf71def84fb47f9af9
BLAKE2b-256 checksum
How to use checksums
a3748de4295dc53ebd959de7fe5cb6612b8c4f34ae298f011711958202f41fa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for increment 0.1.0a3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for increment-0.1.0a3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page