Skip to main content

Python Registry Provider - A tool for managing Python package index sources similar to nrm for npm

Project description

PRP - Python Registry Provider (Python包镜像提供商)

Downloads

目录 (Table of Contents)

PRP (Python Registry Provider) 是一个用于管理Python包镜像源的命令行工具,类似于npm的nrm。它允许您轻松切换不同的Python包镜像,如PyPI、TUNA、阿里云等。

PRP (Python Registry Provider) is a command-line tool for managing Python package index sources, similar to nrm for npm. It allows you to easily switch between different Python package indexes such as PyPI, TUNA, Aliyun, and more.

功能 (Features)

  • 列出所有可用包镜像源 (List all available package index sources)
  • 一键切换包镜像源 (Switch between package index sources with a single command)
  • 支持多源切换 (Support switching to multiple sources simultaneously)
  • 支持自动检测最快源 (Support automatically detecting the fastest source)
  • 支持按速度排序选择前N个源 (Support selecting top N fastest sources by speed)
  • 添加自定义包镜像源 (Add custom package index sources)
  • 支持批量添加多个包镜像源 (Support adding multiple package index sources at once)
  • 删除包镜像源 (Remove package index sources)
  • 支持批量删除多个包镜像源 (Support removing multiple package index sources at once)
  • 恢复默认配置 (Restore to default configuration)
  • 测试包镜像源速度 (Test package index source speeds)
  • 查看当前包镜像源 (View current package index source)

安装 (Installation)

pip install xiaobai-prp

使用方法 (Usage)

列出所有包镜像源 (List all package index sources)

prp ls

切换到最快包镜像源 (Switch to the fastest package index source)

prp use                 # 自动检测并切换到最快的镜像源 (Auto-detect and switch to the fastest source)
prp use --fastest       # 同上,显式指定 (Same as above, explicitly specified)

按速度排序选择前N个镜像源 (Select top N fastest sources by speed)

prp use 1               # 将所有镜像源按网速快慢排序,选择最快的1个镜像源作为主源 (Sort all sources by speed, select the fastest 1 source as main source)
prp use 2               # 将所有镜像源按网速快慢排序,选择最快的2个镜像源,第一个为主源,第二个为备用源 (Sort all sources by speed, select the fastest 2 sources, first as main, second as backup)
prp use 3               # 将所有镜像源按网速快慢排序,选择最快的3个镜像源,第一个为主源,其余为备用源 (Sort all sources by speed, select the fastest 3 sources, first as main, rest as backups)
prp use N               # 将所有镜像源按网速快慢排序,选择最快的N个镜像源 (Sort all sources by speed, select the fastest N sources)

切换单个包镜像源 (Switch to a single package index source)

prp use tuna

切换多个包镜像源 (Switch to multiple package index sources)

# 第一个作为主源,后续作为额外源
prp use aliyun tuna pypi

添加自定义包镜像源 (Add a custom package index source)

prp add myregistry https://myregistry.example.com/simple/

批量添加多个包镜像源 (Add multiple package index sources at once)

# 支持添加多个源,格式为: name1 url1 [home1] name2 url2 [home2]
prp add myregistry1 https://myregistry1.example.com/simple/ myregistry2 https://myregistry2.example.com/simple/

添加带主页的包镜像源 (Add package index source with homepage)

prp add myregistry https://myregistry.example.com/simple/ https://myregistry.example.com

批量添加带主页的多个包镜像源 (Add multiple package index sources with homepages)

prp add myregistry1 https://myregistry1.example.com/simple/ https://myregistry1.example.com myregistry2 https://myregistry2.example.com/simple/ https://myregistry2.example.com

删除包镜像源 (Delete a package index source)

prp del myregistry

批量删除多个包镜像源 (Delete multiple package index sources at once)

prp del myregistry1 myregistry2

恢复默认配置 (Restore to default configuration)

prp reset

测试包镜像源速度 (Test package index source speeds)

# 测试所有源的速度
prp test

# 测试特定源的速度
prp test tuna

显示当前包镜像源 (Show current package index source)

prp current

显示版本信息 (Show version information)

prp version

可用镜像源 (Available Registries)

  • pypi - 官方PyPI仓库 (Official PyPI repository)
  • pypi-test - PyPI测试仓库 (PyPI test repository)
  • tuna - 清华大学镜像 (Tsinghua University mirror)
  • aliyun - 阿里云镜像 (Alibaba Cloud mirror)
  • douban - 豆瓣镜像 (Douban mirror)
  • huawei - 华为云镜像 (Huawei Cloud mirror)
  • ustc - 中国科学技术大学镜像 (University of Science and Technology of China mirror)

贡献 (Contributing)

欢迎贡献!请随时提交Pull Request。 Contributions are welcome! Please feel free to submit a Pull Request.

许可证 (License)

本项目采用GPLv3许可证 - 详见LICENSE文件。 This project is licensed under the GNU General Public License v3 (GPLv3) License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xiaobai_prp-1.0.15.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xiaobai_prp-1.0.15-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file xiaobai_prp-1.0.15.tar.gz.

File metadata

  • Download URL: xiaobai_prp-1.0.15.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.9

File hashes

Hashes for xiaobai_prp-1.0.15.tar.gz
Algorithm Hash digest
SHA256 19a8b195eadfe80cfb4ef3d69c441cb2805ba5a775fc9888e81e5ad04b4d5cf2
MD5 ec98f74b3122da585561b915a80864ab
BLAKE2b-256 8a33e1fde20c10770593da3364fb5bf1f88f67ca8f7a0899d3ded40bc2804799

See more details on using hashes here.

File details

Details for the file xiaobai_prp-1.0.15-py3-none-any.whl.

File metadata

  • Download URL: xiaobai_prp-1.0.15-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.9

File hashes

Hashes for xiaobai_prp-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 6529fbf128b8f6a34fc0ebc56004852777434269a0b8055aa1b1d258683c183e
MD5 a113eb89d89a3f77057ffd1ff8838ba6
BLAKE2b-256 39fe0c5f4a82b89716e5db75f92c7cc045eb47be6d16a3963b80f08ff609f5e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page