Skip to main content

A Python package for analyzing cohort retention and generating insightful visualizations.

Project description

PyPI version License: MIT Python version Tests PyPI - Downloads

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

🚀 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

User Cohort Table

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()

Heatmap of User Cohort Table

💡 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repeatradar-1.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repeatradar-1.0.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

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

Hashes for repeatradar-1.0.0.tar.gz
Algorithm Hash digest
SHA256 45ce8a9bfe371164d720be36bb15e837597578e041a8cb691be987514c12fbe2
MD5 3621b2362c17202017ee892e433be7c8
BLAKE2b-256 09d7f303d6cc2a83e56abbcdb29994462a016401ed460b77a6512de52e177657

See more details on using hashes here.

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

Hashes for repeatradar-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0108b8eb20bc4b62753c7b94651a6d6be1cb11dda52cf97e553ccc86b8166e62
MD5 4274557cba1add477adb4b06497b9f40
BLAKE2b-256 94ea61823c88fc93325cfbe0cd1b87a4f6db329f3ffbf6d0d016c5b6d53dd6d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page