GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(metrics): adoption baseline snapshot script + daily workflow (UF grant D3/D4) by TimeToBuildBob · Pull Request #480 · uniswap-python/uniswap-python Conversation
|
| Metric | Source | Notes |
|---|---|---|
| Stars, forks, watchers, open issues | GitHub API | No auth required |
| Clones + unique visitors (14d) + daily series | GitHub Traffic API | Needs a PAT — default Actions GITHUB_TOKEN 403s on /traffic/*. Daily series is stored so D4 can reconstruct period totals. |
| PyPI downloads (day/week/month) | pypistats.org | No auth required (rolling windows, not period totals) |
| Release history (dates) | PyPI JSON API | No auth required |
Per-version download splits (to directly answer "any v4 pickup?") require BigQuery; documented in script as a TODO.
# Snapshot mode (emits metrics/adoption-YYYY-MM-DD.{json,md}) python3 scripts/adoption_snapshot.py # With traffic data (PAT with Administration:read / public_repo) ADOPTION_GITHUB_TOKEN=github_pat_... python3 scripts/adoption_snapshot.py --strict # Report mode — stars/forks are true deltas; traffic period totals are # reconstructed from the daily series across metrics/adoption-*.json python3 scripts/adoption_snapshot.py --report metrics/adoption-2026-09-02.json
The daily workflow runs at 06:00 UTC. It reads repo secret ADOPTION_GITHUB_TOKEN for traffic collection, runs --strict (no N/A commits on collector failure), and rebases before push. Please add that secret — without it every scheduled run will fail closed rather than write empty traffic.
GitHub Traffic *_14d fields are rolling 14-day windows, not cumulative counters. Report mode does not subtract them. Period clone/view counts are the union of stored daily series. The current UTC day is excluded from those totals (its row is still accumulating). Unique cloners/visitors cannot be summed across days.
None — stdlib only (urllib, json, argparse, datetime, pathlib).
Drafted by Bob (AI agent). Yohan, feel free to adjust the cron schedule or output directory as needed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Adds scripts/adoption_snapshot.py (stdlib-only) that captures:
- GitHub stars, forks, watchers, open issues
- GitHub Traffic: clones/views (14-day window; requires push-access token
— the bundled GH Actions workflow captures this automatically)
- PyPI downloads last day/week/month (pypistats.org)
- Recent release versions and dates
Modes:
Snapshot (default): emits metrics/adoption-YYYY-MM-DD.{json,md}
Report (--report BASELINE.json): prints deltas vs baseline for D4
Also adds .github/workflows/adoption-snapshot.yml (daily at 06:00 UTC)
that runs with the repo's GITHUB_TOKEN so traffic data accumulates before
the 14-day window rolls off.
Initial bootstrap snapshot included (2026-09-02): 1011 stars, 375 forks,
1044 PyPI downloads/month.
Per-version download splits require BigQuery (documented in script TODO).
Co-authored-by: Erik Bjäreholt <[email protected]>
Git-Session-Id: 3b38
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## master #480 +/- ## =========================================== + Coverage 60.52% 73.26% +12.74% =========================================== Files 11 12 +1 Lines 1074 2319 +1245 =========================================== + Hits 650 1699 +1049 - Misses 424 620 +196 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Greptile SummaryThe PR adds a standard-library adoption-metrics collector and daily automation for preserving short-lived GitHub traffic data.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Schedule[Daily schedule or manual run] --> Collect[Collect GitHub and PyPI metrics]
Token{Traffic PAT valid?} -->|Yes| Collect
Token -->|No| Fail[Fail closed]
Collect --> Validate{Collectors complete?}
Validate -->|No| Fail
Validate -->|Yes| Write[Write dated JSON and Markdown]
Write --> Commit[Commit snapshot]
Commit --> Rebase[Rebase onto target branch]
Rebase --> Push[Push snapshot]
Reviews (5): Last reviewed commit: "fix(metrics): pin collection clock so mi..." | Re-trigger Greptile |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
The default Actions GITHUB_TOKEN cannot read /traffic/* (always 403). The workflow now prefers ADOPTION_GITHUB_TOKEN (PAT), runs --strict so failed/skipped collectors do not commit N/A snapshots, retries 429s, and includes traffic deltas in --report. Push path rebases on conflict.
|
Addressed the Greptile P1s in ec22cd4:
Maintainer gate: please add repo secret
@liquid-8 — secret + review whenever you have a moment. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Same fix as uniswap-python#479 — the v1 UNI exchange has no remaining liquidity so get_price_output raises EVM error InvalidJump on mainnet fork. Git-Session-Id: 8f77
|
Pushed d8fccff: xfail the 3 failing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@greptileai review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
GitHub Traffic is a rolling 14-day window, not a cumulative counter. Subtracting two windows produced misleading D4 deltas. Store the daily breakdown (per=day) and union it across snapshots for period clone/view counts. Unique visitors stay point-in-time — they are not additive.
|
@greptileai review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Report mode included today's still-accumulating GitHub Traffic row in D4 period totals, understating clones/views on every 06:00 UTC run. Drop that day from the reconstructed range and label it excluded.
|
@greptileai review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…al day complete_period_end() re-read datetime.now() after collect_metrics() had already stamped snapshot_at. A report that started before UTC midnight and finished after kept the earlier snapshot day, skipped exclusion, and published that day's still-accumulating Traffic row as a complete total. Use one collected_at for snapshot_at, the filename, and period-end exclusion. When now is omitted, key off the snapshot day rather than a fresh clock.
|
@greptileai review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Self-merge not eligible here (cross-repo / pull-only). Greptile 5/5 and all checks green on b8e3a63. Waiting for human review or merge. Remaining after merge: repo secret |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks good to me |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @liquid-8 — LGTM received. Still mergeable and CI-green on b8e3a63; I don't have write access here, so the merge click is yours (or Erik's). After it lands, the daily collector still needs repo secret |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for merging @liquid-8! Post-merge: one setup step needed before snapshots accumulate The daily To enable full snapshots:
Without this secret, the scheduled runs will fail on the traffic step. Other metrics (stars, PyPI downloads) will still work if you want to run without traffic data — but the baseline D3 needs traffic numbers. Once the secret is set, you can trigger a manual run via Actions → Adoption Snapshot → Run workflow to confirm everything works and start accumulating snapshots. The gate for D3 baseline delivery is two snapshots more than one day apart. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Verified the first full retained baseline, @liquid-8: the manual Actions run succeeded at 05:20 UTC today, including strict GitHub Traffic collection. The traffic-token setup is working; no further secret setup request from me. Baseline at 2026-10-12 05:20 UTC:
Retained JSON and Markdown are ready to use as the traffic baseline. The stored daily traffic rows currently cover September 27–October 10. Two limitations for the grant report: the September 2 bootstrap snapshot has no traffic, so we still need a second traffic-bearing snapshot more than 24 hours after today’s to verify accumulation. The daily schedule is 06:00 UTC; today’s second run would not satisfy that spacing. Also, PyPI totals are across all versions: version-split downloads/v4 pickup remain unavailable without the separate BigQuery data. Rolling-window figures are not cumulative grant-period totals, and gaps before collection started cannot be recovered from these snapshots. I’ll verify the next retained full snapshot and close the collection gate; this is baseline tooling/evidence, not a claim that the full D3/D4 grant deliverables are complete. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Collection accumulation confirmed, @liquid-8: 3 traffic-bearing snapshots now in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.