<#20263 Download statistics for release assets> Ne...
# github-notifications
c
#20263 Download statistics for release assets New discussion created by huonw I was curious, so I did an investigation of the download statistics of the released artifacts. I compared: • the PyPI downloads of
pantsbuild.pants
in the last 2 years • the PyPI downloads in the last 30 days • the GitHub Releases downloads across all time (all assets) This plot shows the values for all stable releases since the start of 2022: image Summary: • from the blue series (top), it's clear that 2.13.0 and 2.17.0 at the most popular "ever" releases • from the red series (middle), it's clear that most people are still on 2.17.0 • from the green series (bottom), there's far fewer downloads of 2.18.0 This plot shows the PyPI downloads per day for the last year, for the versions with the most download (we don't have this info available for GitHub assets, AFAICT): image There's hints to me that either: • people aren't transitioning to 2.18.0 as quickly as they did earlier releases • OR, GitHub download stats are fairly different to PyPI ones The raw data is available here: https://gist.github.com/huonw/112684339a5e6e1e947e75890233ff35 • `downloads-2stable.csv`: PyPI and GitHub releases stats for all 2.x.y stable versions • `downloads-all.csv`: PyPI and GitHub releases stats for all versions • `downloads-pypi-year-per-day.csv`: PyPI release stats per day per version for the last year How I computed this BigQuery queries following https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/ 30 days:
Copy code
SELECT file.version, COUNT(*) AS num_downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE file.project = 'pantsbuild-pants'
  -- Only query the last 30 days of history
  AND DATE(timestamp)
    BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
    AND CURRENT_DATE()
GROUP BY file.version
2 years:
Copy code
SELECT file.version, COUNT(*) AS num_downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE file.project = 'pantsbuild-pants'
  -- Only query the last 30 days of history
  AND DATE(timestamp)
    BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 730 DAY)
    AND CURRENT_DATE()
GROUP BY file.version
Downloads per day for the last year:
Copy code
SELECT file.version, COUNT(*) AS num_downloads, DATE_TRUNC(DATE(timestamp), DAY) AS `day`
FROM `bigquery-public-data.pypi.file_downloads`
WHERE file.project = 'pantsbuild-pants'
  -- Only query the last 2 years days of history
  -- Only query the last 30 days of history
  AND DATE(timestamp)
    BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 365 DAY)
    AND CURRENT_DATE()
GROUP BY day, file.version
ORDER BY day DESC
Stats for assets:
Copy code
gh api --paginate -X GET '/repos/pantsbuild/pants/releases' | jq -r '.[] | [.tag_name, ([.assets[].download_count] | add) // 0] | @csv'  |  sort -V
Release dates (from tags)
Copy code
git tag -l 'release_*' --sort=taggerdate --format='%(refname:short),%(taggerdate:short-local)'
pantsbuild/pants