Skip to content

Instantly share code, notes, and snippets.

@njsmith
Created June 24, 2016 20:50
Show Gist options
  • Select an option

  • Save njsmith/4ddbaabf26fd52246e8e5824a2e28f6a to your computer and use it in GitHub Desktop.

Select an option

Save njsmith/4ddbaabf26fd52246e8e5824a2e28f6a to your computer and use it in GitHub Desktop.
SELECT
COUNT(*) AS downloads,
REGEXP_EXTRACT(details.python, r'([0-9]+\.[0-9]+)') AS py_major_minor
FROM
TABLE_DATE_RANGE([the-psf:pypi.downloads], TIMESTAMP("20160601"), CURRENT_TIMESTAMP())
WHERE
file.project = 'scikit-image'
GROUP BY
py_major_minor
ORDER BY
downloads DESC
LIMIT
1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment