Collect Docker Hub and GitHub stats into CSV files and render SVG charts.
- appends Docker Hub snapshots to
stats/dockerhub.csv - appends GitHub snapshots (stars/forks) to
stats/github.csv - generates SVG charts into
svg/ - generates a weekly markdown changelog in
WEEKLY.md - runs automatically via GitHub Actions and commits updates
CSV compaction:
- collectors automatically collapse flat runs of 3+ identical snapshots per repo/metric into 2 boundary points (first + latest), reducing noise and chart markers
collect_dockerhub_stats.py- fetches Docker Hub stats and appends rowsgenerate_dockerhub_chart.py- renders Docker Hub pull chart SVGcollect_github_stats.py- fetches GitHub stars/forks and appends rowsgenerate_github_charts.py- generates 2 SVG files (stars, forks)weekly_log.py- generates weekly report section inWEEKLY.md
Collect stats:
python3 collect_dockerhub_stats.py \
--output stats/dockerhub.csv \
--repos "bavix/gripmock,tkpd/gripmock"Generate chart:
python3 generate_dockerhub_chart.py \
--input stats/dockerhub.csv \
--output svg/gripmock-downloads.svg \
--title "GripMock Docker Hub Downloads" \
--source-label "https://github.com/bavix/artifact-stats/blob/master/stats/dockerhub.csv" \
--color "bavix/gripmock=#34d399,#059669" \
--color "tkpd/gripmock=#f59e0b,#d97706"Generate GitHub charts (2 SVG files):
python3 collect_github_stats.py \
--output stats/github.csv \
--repos "bavix/gripmock,tokopedia/gripmock"
python3 generate_github_charts.py \
--input stats/github.csv \
--output-dir svg \
--output-prefix github \
--title "GripMock GitHub Metrics" \
--source-label "https://github.com/bavix/artifact-stats/blob/master/stats/github.csv" \
--colors "bavix/gripmock=#34d399,#059669;tokopedia/gripmock=#f59e0b,#d97706"Generate weekly report:
python3 weekly_log.py \
--github stats/github.csv \
--docker stats/dockerhub.csv \
--output WEEKLY.mdBehavior:
- if
WEEKLY.mddoes not exist, script creates it - if weekly report for the same ISO week already exists, script skips
- otherwise the new section is inserted at the top (latest first)
collect_github_stats.py skips repositories that return 404 from GitHub API (for example, if the repo does not exist or is private and token has no access).
History for stars/forks is backfilled only when the CSV file does not exist yet (first run).
Color notes:
--color repo=#RRGGBB,#RRGGBBsets gradient start/end--color repo=#RRGGBBsets only base, end color is auto-derived- if
--coloris omitted, colors are auto-assigned deterministically per repo --reposis optional for chart generation; by default all repos from the CSV are rendered
Update .github/workflows/dockerhub-stats.yml job env values:
DOCKERHUB_REPOS- comma-separated reposDOCKERHUB_CHART_TITLE- SVG titleDOCKERHUB_CHART_COLORS- optionalrepo=#RRGGBB,#RRGGBB;repo2=#RRGGBB,#RRGGBBSTATS_CSV/STATS_SVG- output filesDOCKERHUB_SOURCE_URL- source label shown in SVG
Update .github/workflows/github-stats.yml job env values:
GITHUB_REPOS- comma-separated reposGITHUB_STATS_CSV- output CSV pathGITHUB_SVG_DIR/GITHUB_SVG_PREFIX- output SVG filesGITHUB_CHART_TITLE- base title for all GitHub SVG chartsGITHUB_CHART_COLORS- optionalrepo=#RRGGBB,#RRGGBB;repo2=#RRGGBB,#RRGGBBGITHUB_SOURCE_URL- source label shown in SVG
Also set secrets if you need authenticated Docker Hub API access:
DOCKERHUB_USERNAMEDOCKERHUB_PATBOT_TOKEN,GPG_BOT,GPG_PASSPHRASE,GPG_FINGERPRINTfor signed auto-commits
Weekly automation is configured in .github/workflows/weekly.yml.