2016-09-16 20:06:40 +00:00
|
|
|
Retrieving PyPI Download Stats
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
As of May 2016,
|
|
|
|
PyPI download stats are now available from BigQuery at:
|
|
|
|
https://bigquery.cloud.google.com/table/the-psf:pypi.downloads
|
|
|
|
|
|
|
|
Here is an example query for number of downloads in the last 30 days::
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
DATE(timestamp) as day,
|
|
|
|
file.project,
|
|
|
|
file.version,
|
|
|
|
COUNT(*) as total_downloads,
|
|
|
|
FROM
|
|
|
|
TABLE_DATE_RANGE(
|
|
|
|
[the-psf:pypi.downloads],
|
2017-11-16 20:44:51 +00:00
|
|
|
DATE_ADD(CURRENT_TIMESTAMP(), -1, 'month'),
|
2016-09-16 20:06:40 +00:00
|
|
|
CURRENT_TIMESTAMP()
|
|
|
|
)
|
|
|
|
WHERE
|
|
|
|
file.project = 'bidict'
|
|
|
|
GROUP BY
|
|
|
|
day, file.project, file.version
|
|
|
|
ORDER BY
|
|
|
|
day asc
|
|
|
|
LIMIT
|
|
|
|
99999999
|