Lifetimes
Measure customer lifetime value in Python
What it is and what it does
Lifetimes is a Python library for modeling and predicting customer lifetime value (CLV) and churn using probabilistic methods grounded in survival analysis. It implements models like BG/NBD and Pareto/NBD that estimate how often a customer will return and their long-term value based on historical transaction data (frequency, recency, and age). The library treats customer engagement as a "birth-death" process: users are alive while active and may die (churn) after inactivity.
The package depends on numpy, scipy, pandas, autograd, and dill for numerical computation and serialization. It is designed for business analytics workflows where you have transaction histories and want to segment customers by predicted value or identify likely churners. The library was last released in 2020 and its repository is now archived, meaning no active maintenance or updates are occurring.
Use it for:
- Predict which customers are likely to churn based on their purchase history and engagement patterns.
- Estimate the lifetime value of customers to prioritize retention and marketing spend.
- Forecast repeat purchase frequency and timing for subscription or e-commerce businesses.
- Segment customers into cohorts by predicted value for targeted retention campaigns.
- Analyze user engagement on websites or apps to identify inactive or at-risk users.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Lifetimes models customer behavior and predicts lifetime value, churn, and repeat purchase likelihood using probabilistic survival-analysis methods on transaction history.
Yes, if you need CLV modeling and can accept an unmaintained package. The library is stable for its core use case (BG/NBD and Pareto/NBD models) and has no known vulnerabilities. However, verify dependency compatibility with your Python version first, and consider whether a maintained fork or alternative exists for your specific use case, given the project's archived status since 2024.
Install
lifetimes on PyPI
pip
pip install lifetimesuv
uv add lifetimespoetry
poetry add lifetimesInstalling Lifetimes
Before you install
Low install friction; pure Python wheel. Repository is archived and last release was 2020-07-06, over 4 years old. Maintenance is abandoned, so no active bug fixes or dependency updates.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must retain the license notice in distributions.
Quickstart
pip install lifetimes
from lifetimes import BetaGeoFitter
import pandas as pd
bgf = BetaGeoFitter()
bgf.fit(data) # data: DataFrame with frequency, recency, T columns
Requires numpy, scipy, pandas, autograd, and dill; no Python version constraint specified in package metadata.
Verify before relying
- Whether the package works reliably with modern Python versions (3.10+) given its last release predates widespread adoption.
- Current compatibility of dependencies (numpy, scipy, pandas, autograd, dill) with the pinned or unpinned versions Lifetimes expects.
- Whether community forks or maintained alternatives have superseded this archived project.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — numpy, scipy, pandas, autograd, dill |
| Maintenance | abandoned — 2,230 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 255,230/month — #8,482 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Lifetimes-0.11.3-py3-none-any.whl
Keywords: customer lifetime value, clv, ltv, BG/NBD, pareto/NBD, frequency, recency
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
lifelineslifelines implements survival analysis…
permissive · top 5,000 on PyPI
pymc-marketingPyMC-Marketing provides Bayesian statistical…
permissive · top 15,000 on PyPI
scikit-survivalscikit-survival provides survival analysis…
copyleft · top 15,000 on PyPI
carelyticsCarelytics provides healthcare data cleaning,…
permissive · top 15,000 on PyPI
reliabilityReliability engineering and survival analysis…
copyleft · top 5,000 on PyPI
dartsDarts provides forecasting and anomaly…
permissive · top 15,000 on PyPI
business-durationCalculates business duration between two dates…
permissive · top 15,000 on PyPI
matrice-analyticsProvides post-processing and analytics for…
unclear · top 5,000 on PyPI
statsforecastStatsForecast provides fast implementations of…
permissive · top 5,000 on PyPI
zope.processlifetimeProvides event interfaces and implementations…
unclear · top 15,000 on PyPI