为什么 PyPi 不再显示下载统计信息?

Why PyPi doesn't show download stats anymore?

了解该软件包是否流行非常方便(即使它的流行是另一个流行软件包中某些 "import" 案例的原因)。但是现在不知为何我没有看到这个信息。

一个例子:https://pypi.python.org/pypi/blist

为什么他们关闭了这个有用的东西?

正如在 this mail.python.org article 中看到的那样,下载统计数据已被删除,因为它们没有更新并且很难修复。

文章作者 Donald Stufft 列出了这些原因:

There are numerous reasons for their removal/deprecation some of which are:

  • Technically hard to make work with the new CDN
    • The CDN is being donated to the PSF, and the donated tier does not offer any form of log access
    • The work around for not having log access would greatly reduce the utility of the CDN
  • Highly inaccurate
    • A number of things prevent the download counts from being inaccurate, some of which include:
      • pip download cache
      • Internal or unofficial mirrors
      • Packages not hosted on PyPI (for comparisons sake)
      • Mirrors or unofficial grab scripts causing inflated counts (Last I looked 25% of the downloads were from a known mirroring script).
  • Not particularly useful
    • Just because a project has been downloaded a lot doesn't mean it's good
    • Similarly just because a project hasn't been downloaded a lot doesn't mean it's bad

最近发现可以通过这个link.

查询贡献给PSF基金会的PyPI的Big Query数据库

我还写了一个 blog post 关于如何获取此信息的文章,如果你想看一看。

pypinfo 程序是一个 Python3 command-line 程序,可通过 pip 安装到 BigQuery。如果您设置凭据(一个 JSON 文件),您应该能够写:

$ pypinfo -d 1825 blist year
Served from cache: False
Data processed: 250.31 GiB
Data billed: 250.31 GiB
Estimated cost: .23

| download_year | download_count |
| ------------- | -------------- |
|         2,017 |        443,067 |
|         2,016 |        391,816 |
|         2,018 |         57,689 |

有关数据收集的一些信息可在 https://packaging.python.org/guides/analyzing-pypi-package-downloads/

获得

刚发布https://pepy.tech/查看某个包的下载量。我使用了 BigQuery 的数据,所以你会得到相同的结果:-)