clvkit
github.com
- Free plan
What clvkit is
clvkit is an open-source Python library for estimating customer lifetime value in non-contractual businesses. Its buy-till-you-die models include BG/NBD, MBG/NBD for customers who may not return after a first purchase, and Gamma-Gamma for spend per transaction. The library combines purchase and spending models to calculate discounted lifetime value. It also provides cohort retention, revenue, and survival analysis through cohort tables, heatmaps, and acquisition-cohort survival estimates. Input is a transaction log containing customer ID, date, and amount. Predictions can be exported as pandas DataFrames or JSON and plotted. Installation works with uv or pip and requires Python 3.11 or later. Runtime dependencies are numpy, scipy, pandas, and matplotlib; Dask is optional for summarizing large logs. The project reports Dask becomes faster than pandas around four million transactions, while its default in-process scheduler used more peak memory in measured benchmarks. The stated scope excludes covariates, Bayesian fitting, and additional model families. clvkit is licensed under BSD-3-Clause and links to GitHub Issues for support.
Who it suits
It suits analysts who want a focused maximum-likelihood workflow for customer lifetime value and cohort analysis. Users need Python 3.11 or later and transaction-level customer data.
Good to know, and what to watch
- Open-source BSD-3-Clause license
- Includes BG/NBD, MBG/NBD, and Gamma-Gamma models
- Exports predictions to pandas or JSON
- Provides cohort retention and survival analysis
- Optional Dask support for large logs
- Requires Python 3.11 or later
- Excludes covariates and Bayesian fitting
- Model roster does not include additional families
- Dask used more peak memory in reported benchmarks
The verdict
clvkit offers a narrow set of customer-value models with cohort analysis and standard Python outputs. It is suited to analysts comfortable with its stated model limits and transaction-log input.
What the maker publishes
- CLV and cohorts
- The library composes purchase and spend models to estimate discounted lifetime value and provides cohort retention, revenue, and survival analysis. source
- Cohort analysis
- CohortMatrix produces retention or revenue cohort tables and heatmaps, while CohortSurvival estimates survival by acquisition cohort. source
- Core models
- Its models include BG/NBD, MBG/NBD for customers who may never return after their first purchase, and Gamma-Gamma for spend per transaction. source
- Customer predictions
- Its pipeline predicts expected purchases, expected spend, and discounted customer lifetime value. source
- Dependencies
- The project lists numpy, scipy, pandas, and matplotlib as its four runtime dependencies, with Dask available as an optional extra for summarizing large logs. source
- Input and output
- It accepts transaction logs with customer ID, date, and amount, and prediction results can be converted to pandas DataFrames or JSON and plotted. source
- Install requirements
- The package installs with pip or uv, requires Python 3.11 or later, and has four runtime dependencies: numpy, scipy, pandas, and matplotlib. source
- Intended users
- The README describes it as a narrower tool for analysts who want model parameters and a CSV through a maximum-likelihood workflow. source
- Large logs
- The README reports that Dask becomes faster than pandas at around four million transactions, while its default in-process scheduler used more peak memory in the measured benchmarks. source
- Large logs
- An optional Dask extra supports transaction-log summarization, with the README reporting a performance crossover at about 4 million transactions. source
- License
- The repository identifies its license as BSD-3-Clause. source
- License
- The package metadata identifies its license as BSD-3-Clause. source
- Limits
- The stated model scope excludes covariates, Bayesian fitting, and additional model families. source
- Limits
- The project says it does not include covariates, Bayesian fitting, or additional model families. source
- Maintainer
- The README says the author is building customer-analytics work on top of clvkit and intends the library to remain installable and correct. source
- Models
- The model roster is BG/NBD, MBG/NBD, and Gamma-Gamma, with CLV composing transaction and spend models. source
- Outputs
- Prediction results can be converted to pandas or JSON and plotted. source
- Purpose
- clvkit provides buy-till-you-die models for estimating customer lifetime value in non-contractual businesses. source
- Purpose
- clvkit is a Python library for estimating customer lifetime value and cohort retention from transaction logs for non-contractual businesses. source
- Python requirements
- Installation is available with uv or pip and requires Python 3.11 or later. source
- Support
- The project links to its GitHub Issues page for issue reporting. source
- Validation
- The README says CI checks that BG/NBD and Gamma-Gamma fits reproduce published estimates and runs those checks on pushes, pull requests, and before releases. source
- Validation
- CI checks reproduced published BG/NBD and Gamma-Gamma estimates on the CDNOW sample on pushes, pull requests, and before releases. source
Checked against the maker's pages on 11 Oct 2026.