Skip to main content

Monitor and automate your GitHub repository traffic analytics.

Project description

🚀 GitHub Traffic Dashboard 📊

License Python PyPI Streamlit Automation

Beautiful GitHub traffic analytics for all your repositories — public and private. 📈

Please consider giving this project a ⭐ if you find it helpful!


🔴 Try the live demo: git-traffic-dashboard.streamlit.app

A local-only GitHub traffic analytics tool with two modes:

  • 🖥️ Web UI — Beautiful Streamlit dashboard (recommended)
  • ⌨️ CLI — Terminal output + CSV export

View 14-day views, clones, referrers, and popular paths for all your repositories. Everything runs on your machine. Your token never leaves your device.

GitHub Traffic Dashboard


🚨 The 14-Day Catch (And How to Fix It!)

⚠️ Did you know? GitHub normally only saves your repository traffic data for 14 days. After two weeks, your valuable views and clones data is permanently deleted.

Don't lose your data! We built a companion automation tool that runs silently in the background every 13 days using GitHub Actions to fetch and save your data permanently.

👉 Set up GitHub Traffic Automation here (It takes literally 2 minutes to set up!)

Once you have your automated data saved, you can seamlessly plug it right into this dashboard to visualize your beautiful, long-term historical charts.


✨ Features

Feature Streamlit UI CLI
Dual Mode Interface (Live API & CSV Upload)
Token input (no hardcoding)
Upload & visualize historical CSV data
Summary metrics (views, clones, stars, forks)
Bar & line charts per repository
Per-repo daily views & clones chart
Top referrers & popular paths
Searchable repository list
Export to CSV ✅ (download button) ✅ (file)
Runs 100% locally

🛠️ Installation

You can install the package directly from PyPI.

# Basic CLI installation
pip install github-traffic-monitor

# Installation with Dashboard UI support
pip install "github-traffic-monitor[dashboard]"

Generating a GitHub Personal Access Token (PAT)

To use either the CLI or Dashboard, you'll need a GitHub token.

  1. Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Click Generate new token (classic)
  3. Select the repo scope — required to read traffic data for private repositories
  4. Click Generate token and copy it immediately

🔒 Security Note: Your token is completely safe, used only on your machine, and never sent to any external server.


🖥️ Run: Streamlit Dashboard (Recommended)

If you installed with the [dashboard] extra, you can launch the beautiful web UI with a single command:

github-traffic-monitor dashboard

The app opens automatically in your browser at http://localhost:8501. Paste your GitHub token into the sidebar and explore!


⌨️ Run: CLI (Terminal Mode)

If you just want terminal output or to export CSV files, you can use the CLI commands.

Fetch data and print to terminal:

github-traffic-monitor fetch --token ghp_your_token_here

Fetch data and save to a specific CSV file:

github-traffic-monitor fetch --token ghp_your_token_here --output my_report.csv

Sync data (Append today's traffic to historical monthly CSVs):

github-traffic-monitor sync --token ghp_your_token_here --dir ./data

You can also store your token in a .env file as GITHUB_TOKEN=ghp_... so you don't have to type it out every time.


📊 CSV Output Columns

Column Description
Repository Full repo name (user/repo)
Private True / False
Stars Current star count
Forks Current fork count
Total Views Page views in last 14 days
Unique Visitors Unique visitors in last 14 days
Total Clones Clone count in last 14 days
Unique Cloners Unique cloners in last 14 days
Top Referrer Highest-traffic referral source
Top Referrer Views View count from top referrer
Top Path Most visited path
Top Path Views View count for top path
Fetched At UTC timestamp of the fetch

⚠️ Requirements

  • Python 3.9+
  • A GitHub account with at least one repository
  • A GitHub Personal Access Token with the repo scope

🛠️ Development Install

git clone https://github.com/ameyac11/github-traffic-monitor
cd github-traffic-monitor
pip install -e ".[dev,dashboard]"

🧪 Running Tests

pip install pytest
pytest

📜 CHANGELOG

See the CHANGELOG


🌟 Show Your Support

If you find this project useful, please consider giving it a ⭐ on GitHub! It helps more people discover the tool.


📄 License

This project is licensed under the Apache License 2.0.

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

github_traffic_monitor-0.1.0.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

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

github_traffic_monitor-0.1.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file github_traffic_monitor-0.1.0.tar.gz.

File metadata

  • Download URL: github_traffic_monitor-0.1.0.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for github_traffic_monitor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0171a74eb037a666a0b3d1120fd8b75a7dbcd603021e4e3aeb36a7c1ab6c4c0e
MD5 37c427903e6e3bd2d28d52ea99fe238a
BLAKE2b-256 9011b85445b455e0ee651e69ddb8f23bc51d3577712ecfa31038d0c529f757e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for github_traffic_monitor-0.1.0.tar.gz:

Publisher: publish.yml on ameyac11/github-traffic-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file github_traffic_monitor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for github_traffic_monitor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c65b41b4a1c584e12dbeb6f1727791ce9564993df089935bcffabef559a1e29c
MD5 e6cf69d397cabab30f775496b6a91098
BLAKE2b-256 73e27b6010a0f82e5ae4e7c7c6aa89b132c77c2a64afadb4107faa2837989b11

See more details on using hashes here.

Provenance

The following attestation bundles were made for github_traffic_monitor-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ameyac11/github-traffic-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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