Skip to content

Commit 3e22382

Browse files
feat(metrics): adoption baseline snapshot script and daily workflow
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 <erik@bjareho.lt> Git-Session-Id: 3b38
1 parent f5a9e86 commit 3e22382

4 files changed

Lines changed: 490 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Adoption Snapshot
2+
3+
on:
4+
schedule:
5+
# Daily at 06:00 UTC — captures GitHub traffic before the 14-day window rolls off
6+
- cron: "0 6 * * *"
7+
workflow_dispatch: # allow manual runs
8+
9+
permissions:
10+
contents: write # needed to commit snapshot files
11+
12+
jobs:
13+
snapshot:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Run adoption snapshot
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run: python3 scripts/adoption_snapshot.py --out metrics/
22+
23+
- name: Commit snapshot
24+
run: |
25+
git config user.name "github-actions[bot]"
26+
git config user.email "github-actions[bot]@users.noreply.github.com"
27+
git add metrics/
28+
if git diff --staged --quiet; then
29+
echo "No changes to commit (snapshot already up to date)"
30+
else
31+
git commit -m "chore(metrics): daily adoption snapshot $(date -u +%Y-%m-%d)"
32+
git push
33+
fi

‎metrics/adoption-2026-09-02.json‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"snapshot_at": "2026-09-02T01:18:42.212052+00:00",
3+
"repo": "uniswap-python/uniswap-python",
4+
"package": "uniswap-python",
5+
"github": {
6+
"stars": 1011,
7+
"forks": 375,
8+
"watchers": 23,
9+
"open_issues": 65
10+
},
11+
"github_traffic": {
12+
"clones_14d": null,
13+
"unique_cloners_14d": null,
14+
"views_14d": null,
15+
"unique_visitors_14d": null,
16+
"clones_error": "HTTP 403: Forbidden",
17+
"views_error": "HTTP 403: Forbidden"
18+
},
19+
"pypi": {
20+
"error": "HTTP 429: Too Many Requests",
21+
"note": "pypistats.org rate-limited; retry after a few minutes"
22+
},
23+
"pypi_versions": [
24+
{
25+
"version": "0.8.0",
26+
"released": "2026-08-03T09:45:06"
27+
},
28+
{
29+
"version": "0.7.1",
30+
"released": "2023-09-09T12:22:42"
31+
},
32+
{
33+
"version": "0.7.0",
34+
"released": "2023-03-30T13:21:25"
35+
},
36+
{
37+
"version": "0.6.2",
38+
"released": "2022-11-08T13:36:42"
39+
},
40+
{
41+
"version": "0.6.1",
42+
"released": "2022-10-18T12:25:29"
43+
},
44+
{
45+
"version": "0.6.0",
46+
"released": "2022-08-29T10:03:46"
47+
},
48+
{
49+
"version": "0.5.5",
50+
"released": "2022-01-03T09:02:11"
51+
},
52+
{
53+
"version": "0.5.4",
54+
"released": "2021-12-21T09:53:51"
55+
},
56+
{
57+
"version": "0.5.3",
58+
"released": "2021-10-19T10:34:58"
59+
},
60+
{
61+
"version": "0.5.2",
62+
"released": "2021-06-23T13:58:55"
63+
}
64+
]
65+
}

‎metrics/adoption-2026-09-02.md‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# uniswap-python Adoption Snapshot
2+
3+
**Snapshot date**: 2026-09-02T01:18:42.212052+00:00
4+
5+
## GitHub
6+
7+
| Metric | Value |
8+
| --- | --- |
9+
| Stars | 1011 |
10+
| Forks | 375 |
11+
| Watchers | 23 |
12+
| Open Issues | 65 |
13+
14+
## GitHub Traffic (14-day window)
15+
16+
| Metric | Value |
17+
| --- | --- |
18+
| Clones (14d) | N/A |
19+
| Unique Cloners (14d) | N/A |
20+
| Views (14d) | N/A |
21+
| Unique Visitors (14d) | N/A |
22+
23+
## PyPI Downloads
24+
25+
| Period | Downloads |
26+
| --- | --- |
27+
| Last day | N/A |
28+
| Last week | N/A |
29+
| Last month | N/A |
30+
31+
__
32+
33+
## Recent Releases
34+
35+
| Version | Released |
36+
| --- | --- |
37+
| 0.8.0 | 2026-08-03 |
38+
| 0.7.1 | 2023-09-09 |
39+
| 0.7.0 | 2023-03-30 |
40+
| 0.6.2 | 2022-11-08 |
41+
| 0.6.1 | 2022-10-18 |

0 commit comments

Comments
 (0)