feat: add Downloads/Month column to website table

Sourced from website/data/pypi_downloads.tsv the same way
github_stars.json feeds the stars column. The new sortable column
sits between GitHub Stars and Last Commit on the homepage and
category pages, formatted with thousands separators like stars, with
an em dash when no PyPI data exists. Rows are matched by normalized
README display name; Built-in entries never show counts since
same-named PyPI packages are stdlib backports (e.g. the asyncio
package).

Below 960px the column hides and the count moves into the expand
row, mirroring the existing Last Commit treatment. main.js gains the
downloads sort branch and URL param.

The deploy workflow fetches the TSV via the new
make fetch_pypi_downloads target with a daily actions/cache
fallback, mirroring the stars fetch, but non-fatal: the column
degrades to dashes when the fetch fails, unlike stars which the
build requires.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen 2026-08-16 17:52:04 +08:00
parent b440e64cd0
commit cc804b1de2
No known key found for this signature in database
GPG key ID: B93DE4F003C33630
8 changed files with 146 additions and 8 deletions

View file

@ -7,6 +7,9 @@ install:
fetch_github_stars:
uv run python website/fetch_github_stars.py
fetch_pypi_downloads:
uv run python website/fetch_pypi_downloads_via_clickpy.py
test:
uv run pytest website/tests/ -v