Number of installations statistics for PyPI packages?
Question:
I’ve got a couple of packages on the Python Package Index (PyPI) now. Is there any way to get hold of statistics as to how many times they have been downloaded (either manually or via easy_install
or pip
?
Or, alternatively, how many views the main package page has received?
Answers:
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).
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 is a site which I found: https://pypistats.org/packages/py3-pinterest
They track downloads but only for 1 day, 1 week and 1 month. @Dmitry Petrov’s answer is better though.
If you like to filter the data and check all downloads per installer run:
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
So you should see all the installers for e.g:
For more information check useful-queries
You can now use the pypistats website to check your statistics.
For the pytest
package: https://pypistats.org/packages/pytest
The figures are coherent with the bigquery’s ones. For instance for day 13-04
: 501685 downloads without mirror.
Using request :
#standardSQL
SELECT
COUNT(*) AS num_downloads,
SUBSTR(_TABLE_SUFFIX, 7, 8) AS `day`
FROM `the-psf.pypi.downloads*`
WHERE file.project = 'pytest'
AND _TABLE_SUFFIX
BETWEEN FORMAT_DATE(
'%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 10 DAY))
AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
GROUP BY `day`
ORDER BY `day`
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
- Go to pypistats.org;
- search the package name;
- get the statistics of its download. The following figure is the results of
numpy
.
Google Big Query
Second method is Google Big Query, recommended by PiPy officially.
- Go to https://bigquery.cloud.google.com/dataset/the-psf:pypi
- 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
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.
you can use this website for statistics – https://pypistats.org/
if you want to use it in a script you can use the api –
https://pepy.tech/ will show information on the number of downloads and trends over time.
I came across https://www.piwheels.org which shows how many downloads a PyPi library has had. Just add the library you are checking to the end of this url e.g. numpy
I’ve got a couple of packages on the Python Package Index (PyPI) now. Is there any way to get hold of statistics as to how many times they have been downloaded (either manually or via easy_install
or pip
?
Or, alternatively, how many views the main package page has received?
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).
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 is a site which I found: https://pypistats.org/packages/py3-pinterest
They track downloads but only for 1 day, 1 week and 1 month. @Dmitry Petrov’s answer is better though.
If you like to filter the data and check all downloads per installer run:
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
So you should see all the installers for e.g:
For more information check useful-queries
You can now use the pypistats website to check your statistics.
For the pytest
package: https://pypistats.org/packages/pytest
The figures are coherent with the bigquery’s ones. For instance for day 13-04
: 501685 downloads without mirror.
Using request :
#standardSQL
SELECT
COUNT(*) AS num_downloads,
SUBSTR(_TABLE_SUFFIX, 7, 8) AS `day`
FROM `the-psf.pypi.downloads*`
WHERE file.project = 'pytest'
AND _TABLE_SUFFIX
BETWEEN FORMAT_DATE(
'%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 10 DAY))
AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
GROUP BY `day`
ORDER BY `day`
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
- Go to pypistats.org;
- search the package name;
- get the statistics of its download. The following figure is the results of
numpy
.
Google Big Query
Second method is Google Big Query, recommended by PiPy officially.
- Go to https://bigquery.cloud.google.com/dataset/the-psf:pypi
- 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
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.
you can use this website for statistics – https://pypistats.org/
if you want to use it in a script you can use the api –
https://pepy.tech/ will show information on the number of downloads and trends over time.
I came across https://www.piwheels.org which shows how many downloads a PyPi library has had. Just add the library you are checking to the end of this url e.g. numpy