A Python package for analyzing cohort retention and generating insightful visualizations.
Project description
RepeatRadar 📡
A lightweight Python package for calculating and visualizing cohort retention and other cohort-based metrics. With just a few simple commands, you can analyze user behavior and trends over time by grouping users into cohorts based on their acquisition period and tracking their activity or other values (e.g., revenue, transaction count) in subsequent periods.
📖 Overview
- Cohort Analysis Made Easy: Quickly calculate user retention, revenue trends, and other cohort-based metrics.
- Insightful Visualizations: Create heatmaps and retention curves to uncover patterns in your data, enabling deeper insights into user behavior and trends.
🔗 Links
- GitHub: https://github.com/krinya/repeatradar
- PyPI: https://pypi.org/project/repeatradar/
Documentation: https://krinya.github.io/repeatradar/ - Example notebooks:
🚀 Installation
To install RepeatRadar, simply use pip:
pip install repeatradar
📊 Quick Start
Cohort Generation
Here's how you can quickly calculate user cohort data from your dataset:
from repeatradar import generate_cohort_data
# Load your data (example dataset available in examples/data/)
ecommerce_data = pd.read_pickle("https://github.com/krinya/repeatradar/raw/refs/heads/main/examples/data/ecommerce_data_1.pkl")
# Basic Monthly User Cohort Analysis
# This creates a cohort table showing unique user counts for each period
basic_cohorts = generate_cohort_data(
data=ecommerce_data,
date_column='InvoiceDateTime',
user_column='CustomerID',
cohort_period='M', # Monthly cohorts (users grouped by acquisition month)
period_duration=30 # Track in 30-day periods
)
# This shows how many unique users return in each 30-day period
basic_cohorts
Cohort Visualizations
You can visualize the cohort data using heatmaps to better understand user retention trends:
from repeatradar import plot_cohort_heatmap
# Create an interactive heatmap
heatmap_fig = plot_cohort_heatmap(
cohort_data=basic_cohorts, # The cohort data generated above
title="📊 User Retention",
color_scale="viridis",
show_values=True,
show_colorscale=False,
width=900,
height=600
)
heatmap_fig.show()
💡 Tip: For detailed examples and advanced usage, check out the Cohort Calculation Examples and Visualization Examples notebooks.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repeatradar-1.0.0.tar.gz.
File metadata
- Download URL: repeatradar-1.0.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ce8a9bfe371164d720be36bb15e837597578e041a8cb691be987514c12fbe2
|
|
| MD5 |
3621b2362c17202017ee892e433be7c8
|
|
| BLAKE2b-256 |
09d7f303d6cc2a83e56abbcdb29994462a016401ed460b77a6512de52e177657
|
File details
Details for the file repeatradar-1.0.0-py3-none-any.whl.
File metadata
- Download URL: repeatradar-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0108b8eb20bc4b62753c7b94651a6d6be1cb11dda52cf97e553ccc86b8166e62
|
|
| MD5 |
4274557cba1add477adb4b06497b9f40
|
|
| BLAKE2b-256 |
94ea61823c88fc93325cfbe0cd1b87a4f6db329f3ffbf6d0d016c5b6d53dd6d8
|