LysandreJik's picture
Initial commit
38e70c4
raw
history blame
335 Bytes
#standardSQL
SELECT
COUNT(*) AS num_downloads,
DATE_TRUNC(DATE(timestamp), DAY) AS `day`
FROM `bigquery-public-data.pypi.file_downloads`
WHERE
file.project = '<PROJECT_NAME>'
AND DATE(timestamp)
BETWEEN DATE_TRUNC(DATE_SUB(CURRENT_DATE(), INTERVAL 18 MONTH), MONTH)
AND CURRENT_DATE()
GROUP BY `day`
ORDER BY `day` DESC