Skip to content

Instantly share code, notes, and snippets.

@miketheman
Created August 24, 2024 12:25
Show Gist options
  • Save miketheman/9ed181f0278823659468aaf0d37137cb to your computer and use it in GitHub Desktop.
Save miketheman/9ed181f0278823659468aaf0d37137cb to your computer and use it in GitHub Desktop.
PyPI Download stats, past 7 days, grouped by whether user-agent self-reports `ci: true`
SELECT
DATE(timestamp) AS download_date,
COUNTIF(details.ci = TRUE) AS ci_downloads,
COUNTIF(details.ci IS NULL OR details.ci = FALSE) AS non_ci_downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE DATE(timestamp) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
GROUP BY download_date
ORDER BY download_date;
download_date ci_downloads non_ci_downloads
2024-08-17 229683348 801990888
2024-08-18 214902406 780297666
2024-08-19 521170343 1178165232
2024-08-20 559831549 1234938949
2024-08-21 568971308 1247861872
2024-08-22 588119869 1240876425
2024-08-23 524725919 1169773141
2024-08-24 146473373 436462005
@miketheman
Copy link
Author

ci_downloads, non_ci_downloads by download_date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment