- The repo has one executable source file:
generate_waka_heatmap.py. It fetches WakaTime daily insights and rewrites the root SVG artifactswaka-heatmap.svgandwaka-heatmap-dark.svg. .github/workflows/update-graph.ymlis the automation source of truth: it runs onworkflow_dispatchand daily at04:00UTC, installs dependencies withpip install svgwrite requests, runs the script, and commits only the generated SVG files back tomain.
- There is no
requirements.txtorpyproject.toml; local setup matches CI:pip install requests svgwrite. - Required env:
WAKATIME_API_KEY. Optional env:WAKATIME_USERNAMEdefaults tocurrent. - Repo-native verification is minimal:
python -m py_compile generate_waka_heatmap.py, then runpython generate_waka_heatmap.pywith the env vars set and inspect both regenerated SVGs. - The script prints the raw API response and per-day totals to stdout. Noisy logs are expected and are not by themselves a failure.
- The script now uses WakaTime
GET /users/{id}/insights/days?range=last_year, not the old/summariesendpoint. If you change the endpoint or range, re-check the grid math and whether the response still includes one entry per day. - The grid is built as continuous Sunday-through-Saturday columns.
get_data()pads missing leading and trailing days with zeroes sodraw_svg()can rely onindex // 7andindex % 7for placement. - Color levels now use fixed hour buckets (
<1,1-3,4-8,9-10,11-12,13+) and the SVG includes profile-style month labels, weekday labels, and a Less→More legend. Preserve that layout unless the request explicitly changes it. - The README uses a
<picture>element to swapwaka-heatmap.svgandwaka-heatmap-dark.svgbased onprefers-color-scheme; if filenames or paths change, update both the README and workflow.