PyPI BigQuery Stats - details.python null

(Adam Hopkins) #1

I ran a query to see some install stats for Sanic. Here is my query:

SELECT
  REGEXP_EXTRACT(details.python, r"([0-9]+\.[0-9]+)") AS python_version,
  COUNT(*) AS downloads
FROM TABLE_DATE_RANGE(
  [the-psf:pypi.downloads],
  TIMESTAMP("2019-01-01"),
  CURRENT_TIMESTAMP()
)
WHERE file.project="sanic"
AND (file.version="18.12.0" OR file.version="19.3.1")
GROUP BY python_version
ORDER BY downloads DESC

Just curious … does anyone know what would cause a pip install ... to result with a details.python == NULL?

(Donald Stufft) #2

Downloads aren’t only created by pip, for example downloads that happen because a user clicked on the file in their browser are also recorded, or the mirroring infrastructure is another example. So when details.python is NULL, it means we weren’t able to determine what version of Python this was being downloaded for.

2 Likes
(Adam Hopkins) #3

@dstufft Thanks for the answer and for all your work in open source.