Skip to content

Instantly share code, notes, and snippets.

@dstufft
Created January 27, 2019 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstufft/34c06916c404b7db92f3f629de8516a2 to your computer and use it in GitHub Desktop.
Save dstufft/34c06916c404b7db92f3f629de8516a2 to your computer and use it in GitHub Desktop.
SELECT
ROUND(100 * SUM(CASE WHEN REGEXP_EXTRACT(details.installer.version, r"^([^\.]+)") IN ("18", "19") THEN 1 ELSE 0 END) / COUNT(*), 1) AS supports_518,
COUNT(*) as downloads
FROM `the-psf.pypi.downloads*`
WHERE
_TABLE_SUFFIX BETWEEN FORMAT_DATE("%E4Y%m%d", DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
AND FORMAT_DATE("%E4Y%m%d", CURRENT_DATE())
AND details.installer.name = 'pip'
AND file.project = 'cryptography'
LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment