Number of installations statistics for PyPI packages?

Pip statistics is not available on pypi.python.org website and vanity package does not work as well.

Today you can get pip statistics only through this dataset in BigQuery: https://bigquery.cloud.google.com/dataset/the-psf:pypi

Query example for https://pypi.python.org/pypi/dvc package:

SELECT
  details.system.name,
  COUNT(*) as download_count,
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    DATE_ADD(CURRENT_TIMESTAMP(), -31, "day"),
    DATE_ADD(CURRENT_TIMESTAMP(), -1, "day")
  )
WHERE
  file.project = 'dvc'
GROUP BY details.system.name

Please note, some of the download signals are generated by monitoring tools and should not be counted as user's downloads. For example, you should exclude null values from the output:

Row details_system_name download_count   
1   Darwin  1111     
2   null    10000    
3   Windows 222  
4   Linux   3333     

There are at least two packages that help with this: pypstats and vanity. Vanity is very easy to use from the command line:

vanity numpy 

and you'll get a printout to your console.


I have tried the different methods in the other answers. As far as I am concerned, vanity does not work anymore, the reason is here. Pip statistics are not available on pypi.python.org website, the reason is mention in the Python Packaging Guide together with a detailed guide on how you can analyze PyPI download using Google Big Query (summarized below in this answer).

There are 2 methods which are still available.

PyPIstats.org

First method is easier than the second one but seems less reliable as it sometimes returns 429 RATE LIMIT EXCEEDED

  1. Go to pypistats.org;
  2. search the package name;
  3. get the statistics of its download. The following figure is the results of numpy. enter image description here

Google Big Query

Second method is Google Big Query, recommended by PiPy officially.

  1. Go to https://bigquery.cloud.google.com/dataset/the-psf:pypi
  2. Copy the following code into the editor window.
SELECT
  details.installer.name,
  COUNT(*) as download_count,
FROM `the-psf.pypi.downloads*`
WHERE
file.project = 'dvc'
AND _TABLE_SUFFIX
BETWEEN FORMAT_DATE('%Y%m%d', DATE('2020-01-04'))
AND FORMAT_DATE('%Y%m%d', DATE('2020-02-04'))
GROUP BY details.installer.name
  1. Click run button, get the results. The following 2 figures show the code and results of numpy.
    code results

Please noter that the second method requires you have a google cloud account, and require you to provide your credict card information, and has limited query times every day. So I personally recommend the first method.


UPDATE 2: it's back! There's now a "Downloads (All Versions)" just after the list of downloads (below the user-supplied docs).

announcement at http://mail.python.org/pipermail/distutils-sig/2013-June/021344.html - it's currently daily counts; weeks and months will be added as they become available. but, curiously, no total.

UPDATE: this no longer works (the info is not displayed) - see http://mail.python.org/pipermail/distutils-sig/2013-May/020855.html (unfortunately this affects the other answer too).

maybe i'm misunderstanding (sorry) but i think this is on the pypi main page for your project!

see updates above for latest details (i've deleted info below that's no longer correct).

Tags:

Python

Pypi