Request a demo

Public dataset · Web, code and analytics

PyPI Downloads in BigQuery

The pypi dataset logs every file download from the Python Package Index, plus Simple API requests and package metadata. The two log tables are over 1 PiB each, partitioned by day and clustered by project: one package over 30 days reads about 11 GiB, while a careless query can read tens of TiB.

bigquery-public-data.pypi · Python Software Foundation · US · Sizes measured November 23, 2026

3tables
2.5 PiBlogical size
9,973,394,532,433rows
$16,024.53to scan every column once, on-demand

bigquery-public-data.pypi is the Python Package Index dataset. Its description says it is owned by the Python Software Foundation and licensed under Creative Commons Attribution 4.0. All three tables were last modified on the day these sizes were measured.

file_downloads has one row per file downloaded from PyPI, with the project, the file (filename, version, type), the country_code and a details record describing the client: installer, Python version, operating system, CPU and whether it ran in CI. simple_requests has no table description; its columns (url, project, details, http) match file_downloads minus the file record, consistent with logging requests to the Simple index pages that installers read to find files. It is even larger by row count. distribution_metadata holds package metadata per uploaded file (name, version, summary, license, requirements, classifiers and upload time).

The log tables are partitioned by day on timestamp and clustered by project; distribution_metadata is partitioned by month on upload_time. None of them requires a partition filter, so BigQuery will happily run a query that reads the whole history.

Tables and sizes

TableRowsSizeFull scanLayout
file_downloads
One row per file download.
3,774,997,645,5291.3 PiB$8,449.61Partitioned: by day on timestamp · Clustered: project
simple_requests
One row per Simple API index request.
6,198,370,440,9401.2 PiB$7,573.84Partitioned: by day on timestamp · Clustered: project
distribution_metadata
Metadata of every uploaded distribution file.
26,445,964176 GiB$1.08Partitioned: by month on upload_time

Full scan = every column of the table at the on-demand list price of $6.25 per TiB, before your free TiB each month. Selecting fewer columns costs proportionally less. See BigQuery pricing.

Example queries

Daily downloads of one package, last 30 days

Scans 11.0 GiB · $0.07 on-demand

Both filters do work: the date range prunes partitions and project = 'pandas' prunes clustered blocks. Change the project name for your own package.

SELECT
  DATE(timestamp) AS day,
  COUNT(*) AS downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE project = 'pandas'
  AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY) AND DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
GROUP BY day
ORDER BY day;

The same count without a date filter (expensive)

Scans 308 GiB · $1.88 on-demand

Clustering on project still keeps this far below the full table, but dropping the date filter makes it about 28 times more expensive than the 30-day query.

SELECT
  DATE(timestamp) AS day,
  COUNT(*) AS downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE project = 'pandas'
GROUP BY day
ORDER BY day;

Python versions downloading a package, yesterday

Scans 961 MiB · under $0.01 on-demand

REGEXP_EXTRACT trims 3.12.4 style versions to 3.12. details.python can be NULL for clients that do not report it.

SELECT
  REGEXP_EXTRACT(details.python, r'^\d+\.\d+') AS python_version,
  COUNT(*) AS downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE project = 'requests'
  AND DATE(timestamp) = DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
GROUP BY python_version
ORDER BY downloads DESC;

Most downloaded projects, yesterday

Scans 70.3 GiB · $0.43 on-demand

No project filter, so clustering cannot help: one day across all projects reads about 70 GiB.

SELECT project, COUNT(*) AS downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE DATE(timestamp) = DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
GROUP BY project
ORDER BY downloads DESC
LIMIT 20;

Release history of a package since 2024

Scans 610 MiB · under $0.01 on-demand

distribution_metadata is partitioned by month on upload_time, so the date filter limits the scan to recent months.

SELECT version, MIN(upload_time) AS first_upload, ARRAY_AGG(DISTINCT packagetype) AS file_types
FROM `bigquery-public-data.pypi.distribution_metadata`
WHERE name = 'requests'
  AND upload_time >= '2024-01-01'
GROUP BY version
ORDER BY first_upload DESC;

Querying it cheaply

  • Always filter timestamp (or DATE(timestamp)) on file_downloads and simple_requests. The project column alone is about 42 TiB across all partitions, and COUNT(*) with a timestamp IS NOT NULL condition reads about 27 TiB.
  • Filter on project too. The tables are clustered by project, so a one-package query reads a small share of each day.
  • SELECT * on a single day of file_downloads reads about 1.4 TiB, more than the free monthly TiB. Name the columns, and avoid the wide details record unless you need it.
  • Set a maximum bytes billed on ad hoc queries so a missing filter fails instead of running (see the bytes billed limit error).
  • If you report on your packages every week, aggregate daily counts into a small table of your own and query that.

FAQ

How much does it cost to query PyPI downloads in BigQuery?

A 30-day download count for one package reads about 11 GiB, inside the free 1 TiB a month. Without filters it gets expensive fast: one day of SELECT * is about 1.4 TiB, roughly $8.66 at the $6.25 per TiB on-demand list price.

Is the PyPI BigQuery dataset free?

Yes for storage: the data sits in the bigquery-public-data project and Google pays to store it. You pay for the queries you run from your own project. On-demand, the first 1 TiB scanned each month is free, then you pay per TiB scanned (see BigQuery pricing).

How do I count downloads for my Python package in BigQuery?

Query bigquery-public-data.pypi.file_downloads with WHERE project = 'your-package' and a DATE(timestamp) range, then COUNT(*) grouped by day, version (file.version) or installer (details.installer.name).

Which PyPI table should I use to count downloads?

file_downloads. The Python Packaging User Guide describes it as getting one entry for each download. simple_requests has no file column, so it cannot tell you which version or file was fetched.

All public datasets · BigQuery cost queries · Pricing calculator

Cut BigQuery spend without guessing

Masthead attributes compute and storage cost to every project, user, pipeline and table, finds unused and dead-end tables, and shows where editions or on-demand pricing is cheaper. Mnemonic cut its BigQuery compute cost by 20% within 24 hours of onboarding.