Skip to main content

ClonePulse

Your GitHub clone stats, visualized and celebrated.
Track weekly trends, highlight milestones, and share visual dashboards—all automatically.

Use this template
Tests


Add Badges to Your README

ClonePulse can generate badges you can embed in your repo:

# clones
Milestone

A click on a badge takes you to the dashboard.


Clone data summary and outlier handling

clonepulse/fetch_clones.json starts with a summary object containing filtered lifetime totals, raw clone totals, 7-day and 30-day totals and daily averages, and a snapshot of the totals at the last refresh. Rolling periods end on the newest stored day; days_included and days_discarded make each average's denominator explicit.

ClonePulse marks a day as abnormal when its clone-to-unique-cloner ratio is greater than 25. A positive clone count with zero unique cloners is also abnormal. These days remain in daily with their raw values and are described in discard, but they do not contribute to summaries, badges, milestones, or the daily-max annotation. The dashboard replaces an abnormal clone count with the rounded average of up to seven preceding normal days.

{
  "summary": {
    "total_clones": 4437,
    "unique_clones": 2934,
    "total_clones_raw": 4437,
    "last_7_days": {
      "total_clones": 37,
      "unique_clones": 29,
      "average_daily_clones": 5.29,
      "average_daily_unique_clones": 4.14,
      "days_included": 7,
      "days_discarded": 0
    },
    "last_30_days": {
      "total_clones": 197,
      "unique_clones": 143,
      "average_daily_clones": 6.57,
      "average_daily_unique_clones": 4.77,
      "days_included": 30,
      "days_discarded": 0
    },
    "last_refresh": {
      "timestamp": "2026-08-29T02:29:25Z",
      "total_clones": 4437,
      "unique_clones": 2934
    }
  },
  "annotations": [],
  "discard": [],
  "daily": []
}

Example dashboards

Weekly dashboard (default)

A weekly clone activity chart is automatically updated and saved in clonepulse/weekly_clones.png.

  • Runs every Monday morning
  • Discards partial weeks
  • Shows only complete Monday–Sunday periods

Standard clone dashboard, last 16 weeks Command: python src/clonepulse/generate_clone_dashboard.py --user per2jensen --repo clonepulse

Reproducible window (--start + --weeks)

Dashboard starting 2025-08-15 for 6 weeks
Command: python src/clonepulse/generate_clone_dashboard.py --start 2025-09-01 --weeks 8 --user per2jensen --repo clonepulse

Calendar year (--year)

Dashboard for calendar year 2025 (to date)
Command: python src/clonepulse/generate_clone_dashboard.py --year 2025 --user per2jensen --repo clonepulse


Quick Setup

  1. Create a GitHub Token
    See 🔐 Token Setup below.

  2. Drop essentials into your repo
    Copy clonepulse/, src/clonepulse/, pyproject.toml, and the workflows in .github/workflows/. If the destination already has a pyproject.toml, add ClonePulse's runtime dependencies and ensure its build configuration includes the src/clonepulse/ package.

  3. Add badges to your README
    Replace your-username/your-repo:

    [![# clones](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/your-username/your-repo/main/clonepulse/badge_clones.json)](https://github.com/your-username/your-repo/blob/main/clonepulse/weekly_clones.png)
    
    [![Milestone](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/your-username/your-repo/main/clonepulse/milestone_badge.json)](https://github.com/your-username/your-repo/blob/main/clonepulse/weekly_clones.png)
    
  4. Configure the workflow
    Update fetch_clones.yml with your --user and --repo.

    - name: Run fetch_clones.py
      env:
        TOKEN: ${{ secrets.CLONEPULSE_METRICS }}
      run: |
        python -m clonepulse.fetch_clones \
          --user <your GitHub login> \
          --repo <your repo>
    
  5. Generate the dashboard in your workflow

    Default (last 12 weeks):

    - name: Render dashboard
      run: python -m clonepulse.generate_clone_dashboard
    

    Reproducible window:

    - name: Render dashboard
      run: |
        python -m clonepulse.generate_clone_dashboard \
          --start 2025-06-02 --weeks 8
    

    Dashboard title & repo label

    • Banner title always says “Weekly Clone Metrics”.
    • If you provide --user and --repo, the banner also shows user/repo.
    • If only one is provided, that single value is shown.
    • If neither flag is passed, the script falls back to env vars GITHUB_USER / GITHUB_REPO for the label.

    Additional CLI options (can also be used locally):

    PYTHONPATH=src python src/clonepulse/generate_clone_dashboard.py \
      [--user your-username] \
      [--repo your-repo] \
      [--start YYYY-MM-DD --weeks N] \
      [--year YYYY]
    

Token Setup

ClonePulse fetches traffic stats from the GitHub API. This requires a Personal Access Token (PAT).

Permissions

For public repos:

  • Administration: Read-only
  • Metadata: Read-only

For private repos:

  • Administration: Read-only
  • Metadata: Read-only
  • Contents: Read-only
  • Traffic: Read-only

How to Create the Token

  1. Visit https://github.com/settings/tokens
    Click Generate new token → Fine-grained token

  2. Configure:

    • Name: e.g. your-repo_ClonePulse
    • Expiration: e.g. 90 days
    • Resource owner: Your user or organization
    • Repository access: select your repo
    • Permissions: set as above
  3. Generate and copy the token. (You only see it once.)

Add Token to Secrets

  1. Go to your GitHub repository:
    Settings → Secrets and variables → Actions → New repository secret

  2. Name the secret:
    CLONEPULSE_METRICS

  3. Paste the token and save.

Use in Workflow

- name: Run fetch_clones.py
  env:
    TOKEN: ${{ secrets.CLONEPULSE_METRICS }}
  run: python -m clonepulse.fetch_clones

Contributing

Found a bug or want to suggest a feature?
Open an issue or send a PR.


License

ClonePulse is licensed under MIT.

Metadata

Release files for clonepulse 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clonepulse 1.0.6
File Size Uploaded Provenance Actions
clonepulse-1.0.6.tar.gz 124.6 kB Without provenance Details for clonepulse-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clonepulse 1.0.6
File Interpreter ABI Platform Actions
clonepulse-1.0.6-py3-none-any.whl Python 3 none any Details for clonepulse-1.0.6-py3-none-any.whl

Total release size: 143.0 kB

Release files / clonepulse-1.0.6.tar.gz

Download URL clonepulse-1.0.6.tar.gz
Size 124.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e77b00e3dba86b4e0ab30ef8f0fb01199419248b616a3e50097d0f5ede9b975e
BLAKE2b-256 checksum
How to use checksums
c71d64b921212c4ca9253a19a0d90a8b078771d51a3120c81f77a3b31e76934f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / clonepulse-1.0.6-py3-none-any.whl

Download URL clonepulse-1.0.6-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
022b7df200b66b40df488577e56b4d3ac3c66791342ef52fc5df62898033be80
BLAKE2b-256 checksum
How to use checksums
ee9dbd89666c48060850700385e7401b081aab1817d10c89da41d6aa2c5d014e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for clonepulse 1.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page