在我休假回来之后,在 PyPi Stats 中发现 tzfpy 下载量增长了很多:

于是在 ChatGPT 的帮助下在 Big Query 上查了一下下载情况。发现来自 Amazon Linux 的下载量增长最多。 考虑到这个下载量和操作系统一般是商业公司。

逐日下载量#

#standardSQL
SELECT
  DATE(timestamp) as download_date,
  COUNT(*) as daily_downloads
FROM
  `bigquery-public-data.pypi.file_downloads`
WHERE
  file.project = 'tzfpy'
  AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 45 DAY) AND CURRENT_DATE()
GROUP BY
  download_date
ORDER BY
  download_date;
download_datedaily_downloads
2024-05-014695
2024-05-024353
2024-05-033117
2024-05-041835
2024-05-051749
2024-05-063040
2024-05-073686
2024-05-083074
2024-05-093415
2024-05-102720
2024-05-111796
2024-05-122703
2024-05-133571
2024-05-142825
2024-05-153042
2024-05-162862
2024-05-173408
2024-05-182375
2024-05-191814
2024-05-202770
2024-05-213249
2024-05-222953
2024-05-233005
2024-05-243088
2024-05-252575
2024-05-261772
2024-05-272653
2024-05-283451
2024-05-292953
2024-05-303574
2024-05-312922
2024-06-012239
2024-06-021929
2024-06-033370
2024-06-047007
2024-06-0510143
2024-06-0610763
2024-06-0711800
2024-06-0811554
2024-06-098730
2024-06-109359
2024-06-1111746
2024-06-1212906
2024-06-1314255
2024-06-1418068
2024-06-151357

过去 14 天国家/地区的下载量#

#standardSQL
SELECT
  country_code,
  COUNT(*) as download_count
FROM
  `bigquery-public-data.pypi.file_downloads`
WHERE
  file.project = 'tzfpy'
  AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 14 DAY) AND CURRENT_DATE()
GROUP BY
  country_code
ORDER BY
  download_count DESC;
country_codedownload_count
US108081
DE10695
IE6972
AU5165
GB2786
NL496
JP226
HK144
FR123
SE115
CN100
GR56
RU38
CH22
LT21
SG20
UA18
CY17
MX17
PT12
FI11
CO10
ES8
DK7
BE6
TW6
BR6
IN6
SK6
UY5
IL5
AE4
ZA4
LU4
PL3
IS2
GE2
SI2
AT2
PH1
CA1
RS1

过去 14 天不同系统的下载量#

#standardSQL
SELECT
  details.distro.name AS distribution,
  details.distro.version AS distro_version,
  COUNT(*) AS download_count
FROM
  `bigquery-public-data.pypi.file_downloads`
WHERE
  file.project = 'tzfpy'
  AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 14 DAY) AND CURRENT_DATE()
  AND details.distro.name IS NOT NULL
GROUP BY
  distribution, distro_version
ORDER BY
  download_count DESC;
distributiondistro_versiondownload_count
Amazon Linux260748
Debian GNU/Linux1136403
Ubuntu22.0420832
Ubuntu20.047699
Debian GNU/Linux125512
Amazon Linux2023262
Ubuntu18.04173
macOS14.568
Debian GNU/Linux1020
macOS14.4.114
macOS10.1612
Arch Linux6
macOS14.3.16
Ubuntu24.046
macOS14.05
macOS13.44
Arch Linuxrolling4
Manjaro Linux24.0.24
Rocky Linux8.44
Alpine Linux3.17.33
Red Hat Enterprise Linux8.63
macOS13.0.12
macOS10.15.72
macOS13.6.22
Raspbian GNU/Linux102
macOS14.2.12
Manjaro Linux24.0.12
Red Hat Enterprise Linux8.92
AlmaLinux9.32
macOS13.6.42
macOS12.6.31
Raspbian GNU/Linux111
TencentOS Server3.21
Rocky Linux8.51
Linux Mint21.31
macOS13.61

过去一个月每 14 天的不同系统下载量变化#

#standardSQL
WITH Period1 AS (
  SELECT
    details.distro.name AS distribution,
    COUNT(*) AS downloads_period1
  FROM
    `bigquery-public-data.pypi.file_downloads`
  WHERE
    file.project = 'tzfpy'
    AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY) AND DATE_SUB(CURRENT_DATE(), INTERVAL 15 DAY)
    AND details.distro.name IS NOT NULL
  GROUP BY
    distribution
),
Period2 AS (
  SELECT
    details.distro.name AS distribution,
    COUNT(*) AS downloads_period2
  FROM
    `bigquery-public-data.pypi.file_downloads`
  WHERE
    file.project = 'tzfpy'
    AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 14 DAY) AND CURRENT_DATE()
    AND details.distro.name IS NOT NULL
  GROUP BY
    distribution
)
SELECT
  p1.distribution,
  p1.downloads_period1,
  IFNULL(p2.downloads_period2, 0) AS downloads_period2,
  IFNULL(p2.downloads_period2, 0) - p1.downloads_period1 AS change_in_downloads
FROM
  Period1 p1
LEFT JOIN
  Period2 p2
ON
  p1.distribution = p2.distribution
ORDER BY
  change_in_downloads DESC;
distributiondownloads_period1downloads_period2change_in_downloads
Amazon Linux7686101060242
Debian GNU/Linux44004193537535
macOS1161215
Arch Linux8102
Alpine Linux231
AlmaLinux220
openSUSE Tumbleweed10-1
Rocky Linux65-1
SLES10-1
Kali GNU/Linux10-1
Fedora Linux20-2
KDE neon20-2
EndeavourOS20-2
Raspbian GNU/Linux53-2
CentOS Linux30-3
Manjaro Linux96-3
Linux Mint51-4
Ubuntu3294228710-4232

过去一个月每 14 天的国家/地区的下载量变化#

#standardSQL
WITH Period1 AS (
  SELECT
    country_code,
    COUNT(*) AS downloads_period1
  FROM
    `bigquery-public-data.pypi.file_downloads`
  WHERE
    file.project = 'tzfpy'
    AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY) AND DATE_SUB(CURRENT_DATE(), INTERVAL 15 DAY)
  GROUP BY
    country_code
),
Period2 AS (
  SELECT
    country_code,
    COUNT(*) AS downloads_period2
  FROM
    `bigquery-public-data.pypi.file_downloads`
  WHERE
    file.project = 'tzfpy'
    AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 14 DAY) AND CURRENT_DATE()
  GROUP BY
    country_code
)
SELECT
  p1.country_code,
  p1.downloads_period1,
  IFNULL(p2.downloads_period2, 0) AS downloads_period2,
  IFNULL(p2.downloads_period2, 0) - p1.downloads_period1 AS change_in_downloads
FROM
  Period1 p1
LEFT JOIN
  Period2 p2
ON
  p1.country_code = p2.country_code
ORDER BY
  change_in_downloads DESC;
country_codedownloads_period1downloads_period2change_in_downloads
US2903010808379053
DE705106959990
AU232651652839
GB18527862601
JP3226223
RU193819
CH62216
SG92011
PT21210
UA10188
IN462
CO9101
BR561
TW86-2
NZ20-2
GE42-2
MX2017-3
RS41-3
ID40-4
AT72-5
SI92-7
ES178-9
GF100-10
BE196-13
HR140-14
DK427-35
FI4611-35
DO360-36
LT6921-48
NL544496-48
CA791-78
ZA2514-247
CN638100-538
HK883144-739
FR882123-759
KR10290-1029
IE84946972-1522