Add script: merged PR count per author aggregated by week over the past year#97
Merged
Add script: merged PR count per author aggregated by week over the past year#97
Conversation
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/452c41d6-d398-4a66-b857-558224a8b8a7 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add notebook to report merged PRs per person weekly
Add notebook: merged PR count per author aggregated by week over the past year
Apr 24, 2026
xadupre
reviewed
Apr 24, 2026
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/a014fc92-18dd-45ab-bfde-5ceac46f5764 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
xadupre
reviewed
Apr 24, 2026
xadupre
reviewed
Apr 24, 2026
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/165cfed9-fab7-41fa-8323-206c02efe66c Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
xadupre
reviewed
Apr 24, 2026
xadupre
reviewed
Apr 24, 2026
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/fa66ca3f-8015-4f8d-9840-12e3b51b006f Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/e9c51566-3ef2-4456-9c5a-f2873fae04a4 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Collaborator
|
@copilot can you replace this by a script outputting images (not a notebook) |
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/52588561-50c4-49d5-8656-4e9a19a3fde0 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Contributor
Author
Done in f0e2806. The notebook has been replaced by Output files produced when running
|
Copilot
AI
changed the title
Add notebook: merged PR count per author aggregated by week over the past year
Add script: merged PR count per author aggregated by week over the past year
Apr 24, 2026
xadupre
reviewed
Apr 24, 2026
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/78df380d-d74e-4801-8672-455b68860a6a Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
…elist) Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/f5034d42-d080-4395-b703-b6b441ef8a95 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Contributor
Author
….com/sdpython/teachpyx into copilot/add-merged-prs-weekly-report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates a standalone Python script that queries the GitHub REST API for merged PRs on one or more repositories, aggregates the results by author and ISO week over the trailing 365 days, and saves the visualisations as PNG images. Fetched data is cached locally to minimise repeated API calls.
New:
_doc/practice/years/2026/github_stat_pr.pyprs_cache_{owner}_{repo}.csv); only fetches PRs merged after the latest cached date from the API (full fetch on first run); merges new rows with the cache, deduplicates, prunes entries older than 365 days, and saves the updated cache. ACACHE_DIRparameter (default".") controls where the files are stored.AUTHOR_WHITELISTparameter (default[]) lets you restrict the analysis to a specific set of GitHub usernames; leave it empty to include all authors. The whitelist applies only to the per-author bar and heatmap charts; the cross-repo line chart always reflects all authors.(repo, author, week)where week is the Monday of each ISO week; produces a combined pivot table (all repos summed, authors ranked by total PR count) as well as per-repo pivot tables when multiple repos are listed.imshowheatmap (author × week) aggregated across all repos; saved asgithub_stat_pr_bar.pngandgithub_stat_pr_heatmap.png.github_stat_pr_lines.png.github_stat_pr_bar_{owner}_{repo}.png,github_stat_pr_heatmap_{owner}_{repo}.png), with the repo name included in the chart title.RuntimeErrorfor HTTP 401 (bad token), 403 (rate-limited), and 404 (repo not found).Run with:
New:
_doc/practice/years/2026/github_stat_pr.rstDocumentation page with a
literalincludeof the script, keeping the toctree entry inindex.rstfunctional.Updated:
_doc/practice/years/2026/index.rstAdded
github_stat_prto the toctree.