pip-fc
pip-fc 全称是:pip fast check
pip-fc 是一个轻量级的 Python 工具,旨在测试多个镜像源的连接速度,并帮助用户选择最快的镜像源进行软件包安装。支持 Python 2.7 和 3.x 版本,能够自动根据环境选择适合的并发模式(asyncio 或 threading)。
功能
- 测试多个镜像源的连接速度。
- v0.1.12: 丢弃了部分过时的mirror,使用文件实际下载速度进行测速
- 自动选择连接速度最快的镜像源。
- 支持 Python 2.7 和 3.x 版本。
- 使用异步(
asyncio)或线程池(threading)来提高测试效率。 - 简单易用的命令行界面。
安装
使用 pip 安装:
pip install pip-fc
使用方法
通过运行以下命令启动:
pip-fc 或者 python -m pip_fc
此命令将会测试预设的镜像源,并显示连接速度最快的镜像源。你也可以自定义镜像源进行测试。
设置全局镜像源
如果你希望将测试中找到的最快镜像源设置为全局 pip 镜像源,可以在运行完成后输入 y 来确认:
Do you want to set the fastest mirror as the global pip mirror? (y/n): y
此操作将更新 pip 的配置文件,设置全局镜像源和回退镜像源。
依赖
pip:用于安装和管理 Python 包。futures:仅在 Python 2.7 环境下需要,安装时自动处理。
示例输出 v2
Detected Python Version: 3.12.12 (asyncio)
========================================
--- Starting HTTP download (v2) for speedtest (4096 bytes, 3 times average) ---
Mirror HTTP Download Test Results (sorted by speed):
----------------------------------------
Speed (KB/s) URL
----------------------------------------
27.53 https://mirrors.cloud.tencent.com/pypi/simple/
26.83 https://mirrors.ustc.edu.cn/pypi/simple/
16.45 https://pypi.tuna.tsinghua.edu.cn/simple/
16.39 https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/
2.33 https://repo.huaweicloud.com/repository/pypi/simple/
0.51 https://mirrors.aliyun.com/pypi/simple/
----------------------------------------
*** Fastest mirror is: https://mirrors.cloud.tencent.com/pypi/simple/ (speed: 27.53 KB/s)
= = = = = = = = = = = = = = = = = = = =
Do you want to set the fastest mirror as the global pip mirror? (y/n):
Timeout reached! No input received.
Skipping mirror setup.
示例输出 v1
Detected Python Version: 3.8.5 (asyncio)
--- Starting connection speed test using asyncio mode ---
Successfully tested 6 mirrors.
Fastest Mirror: https://pypi.tuna.tsinghua.edu.cn/simple/
Latency: 50.12345 ms
--- All Successful Connection Results (URL, Latency in ms) ---
https://pypi.tuna.tsinghua.edu.cn/simple/: 50.12345 ms
https://mirrors.aliyun.com/pypi/simple/: 65.67890 ms
...
贡献
欢迎提出问题、提交 bug 或者贡献代码。如果你有任何问题,或者希望添加新特性,请提交 issue。
许可
该项目采用 MIT 许可证,详情请见 LICENSE 文件。
Metadata
Release files for pip-fc 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pip_fc-0.1.12.tar.gz | 11.7 kB | Without provenance | Details for pip_fc-0.1.12.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pip_fc-0.1.12-py3-none-any.whl | Python 3 | none | any | Details for pip_fc-0.1.12-py3-none-any.whl |
| pip_fc-0.1.12-py2-none-any.whl | Python 2 | none | any | Details for pip_fc-0.1.12-py2-none-any.whl |
Total release size: 33.1 kB
Release files / pip_fc-0.1.12.tar.gz
| Download URL | pip_fc-0.1.12.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5e5e552bfda798ee7a685b24605eed7a827fc43dd0a6409132624426c54ac0e
|
|
BLAKE2b-256 checksum How to use checksums |
0b63c4219953b7d8e8ed78e67b6643048c9c1467e0b792fe435ccbb37249e983
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pip_fc-0.1.12-py3-none-any.whl
| Download URL | pip_fc-0.1.12-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81a65410f0177ef66c54322d5c19bd0803e17459fcbf4d919eef48546f3f7946
|
|
BLAKE2b-256 checksum How to use checksums |
cbc5fa0b457c86bc36e09b83d745249e256dedf0f4747236e20671dca8c76235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pip_fc-0.1.12-py2-none-any.whl
| Download URL | pip_fc-0.1.12-py2-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
03a705afc43a3d3755d4767c0660bf0a509d2ff6d86bca4916885beb5a7128ac
|
|
BLAKE2b-256 checksum How to use checksums |
5f82643e9c4e72f5ac0d92a5f2d0a71c7ef2817478d07821cd9c7eee35b3003e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for pip-fc 0.1.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.