在我休假回来之后,在
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_date daily_downloads 2024-05-01 4695 2024-05-02 4353 2024-05-03 3117 2024-05-04 1835 2024-05-05 1749 2024-05-06 3040 2024-05-07 3686 2024-05-08 3074 2024-05-09 3415 2024-05-10 2720 2024-05-11 1796 2024-05-12 2703 2024-05-13 3571 2024-05-14 2825 2024-05-15 3042 2024-05-16 2862 2024-05-17 3408 2024-05-18 2375 2024-05-19 1814 2024-05-20 2770 2024-05-21 3249 2024-05-22 2953 2024-05-23 3005 2024-05-24 3088 2024-05-25 2575 2024-05-26 1772 2024-05-27 2653 2024-05-28 3451 2024-05-29 2953 2024-05-30 3574 2024-05-31 2922 2024-06-01 2239 2024-06-02 1929 2024-06-03 3370 2024-06-04 7007 2024-06-05 10143 2024-06-06 10763 2024-06-07 11800 2024-06-08 11554 2024-06-09 8730 2024-06-10 9359 2024-06-11 11746 2024-06-12 12906 2024-06-13 14255 2024-06-14 18068 2024-06-15 1357
过去 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_code download_count US 108081 DE 10695 IE 6972 AU 5165 GB 2786 NL 496 JP 226 HK 144 FR 123 SE 115 CN 100 GR 56 RU 38 CH 22 LT 21 SG 20 UA 18 CY 17 MX 17 PT 12 FI 11 CO 10 ES 8 DK 7 BE 6 TW 6 BR 6 IN 6 SK 6 UY 5 IL 5 AE 4 ZA 4 LU 4 PL 3 IS 2 GE 2 SI 2 AT 2 PH 1 CA 1 RS 1
过去 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 ;
distribution distro_version download_count Amazon Linux 2 60748 Debian GNU/Linux 11 36403 Ubuntu 22.04 20832 Ubuntu 20.04 7699 Debian GNU/Linux 12 5512 Amazon Linux 2023 262 Ubuntu 18.04 173 macOS 14.5 68 Debian GNU/Linux 10 20 macOS 14.4.1 14 macOS 10.16 12 Arch Linux 6 macOS 14.3.1 6 Ubuntu 24.04 6 macOS 14.0 5 macOS 13.4 4 Arch Linux rolling 4 Manjaro Linux 24.0.2 4 Rocky Linux 8.4 4 Alpine Linux 3.17.3 3 Red Hat Enterprise Linux 8.6 3 macOS 13.0.1 2 macOS 10.15.7 2 macOS 13.6.2 2 Raspbian GNU/Linux 10 2 macOS 14.2.1 2 Manjaro Linux 24.0.1 2 Red Hat Enterprise Linux 8.9 2 AlmaLinux 9.3 2 macOS 13.6.4 2 macOS 12.6.3 1 Raspbian GNU/Linux 11 1 TencentOS Server 3.2 1 Rocky Linux 8.5 1 Linux Mint 21.3 1 macOS 13.6 1
过去一个月每 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 ;
distribution downloads_period1 downloads_period2 change_in_downloads Amazon Linux 768 61010 60242 Debian GNU/Linux 4400 41935 37535 macOS 116 121 5 Arch Linux 8 10 2 Alpine Linux 2 3 1 AlmaLinux 2 2 0 openSUSE Tumbleweed 1 0 -1 Rocky Linux 6 5 -1 SLES 1 0 -1 Kali GNU/Linux 1 0 -1 Fedora Linux 2 0 -2 KDE neon 2 0 -2 EndeavourOS 2 0 -2 Raspbian GNU/Linux 5 3 -2 CentOS Linux 3 0 -3 Manjaro Linux 9 6 -3 Linux Mint 5 1 -4 Ubuntu 32942 28710 -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_code downloads_period1 downloads_period2 change_in_downloads US 29030 108083 79053 DE 705 10695 9990 AU 2326 5165 2839 GB 185 2786 2601 JP 3 226 223 RU 19 38 19 CH 6 22 16 SG 9 20 11 PT 2 12 10 UA 10 18 8 IN 4 6 2 CO 9 10 1 BR 5 6 1 TW 8 6 -2 NZ 2 0 -2 GE 4 2 -2 MX 20 17 -3 RS 4 1 -3 ID 4 0 -4 AT 7 2 -5 SI 9 2 -7 ES 17 8 -9 GF 10 0 -10 BE 19 6 -13 HR 14 0 -14 DK 42 7 -35 FI 46 11 -35 DO 36 0 -36 LT 69 21 -48 NL 544 496 -48 CA 79 1 -78 ZA 251 4 -247 CN 638 100 -538 HK 883 144 -739 FR 882 123 -759 KR 1029 0 -1029 IE 8494 6972 -1522