Skip to content

Latest commit

 

History

History
138 lines (94 loc) · 2.93 KB

README_en.md

File metadata and controls

138 lines (94 loc) · 2.93 KB

PyPI Plugin User Guide

中文 | English

Introduction

This is a plugin for oh-my-zsh to manage PyPI mirrors. The plugin provides several convenient commands to list available PyPI mirrors, switch mirrors, and test mirror connectivity.

Installation

Using git

git clone https://github.com/belingud/pypi ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/pypi

Or copy the plugin script to the ~/.oh-my-zsh/custom/plugins/ directory manually, then add the plugin name to ~/.zshrc. For example:

plugins=(... pypi ...)

Usage

Basic Commands

  1. List Supported Mirrors

    pypi list

    This command lists all supported PyPI mirrors and their URLs.

  2. Switch Mirrors

    pypi use <shortname>

    Switch to the specified mirror, where <shortname> is the mirror's short name. For example:

    pypi use aliyun
  3. Test Mirror Connectivity

    pypi ping <shortname|url>

    Check the network connectivity of the specified mirror, where <shortname> is the mirror's short name, or you can directly use the mirror's URL. For example:

    pypi ping tsinghua

    or

    pypi ping https://pypi.org/simple/

Command Details

  • pypi list lists all supported PyPI mirrors and their URLs.
  • pypi use <shortname> switches to the specified PyPI mirror.
  • pypi ping <shortname|url> tests the network connectivity of the specified mirror or URL.

Examples

List all supported mirrors:

pypi list

Switch to the Aliyun mirror:

pypi use aliyun

Test the connectivity of the Tsinghua mirror:

pypi ping tsinghua

Supported Mirrors

Here are some supported PyPI mirrors and their short names:

More mirrors can be viewed by running pypi list.

Notes

  • The ping command accepts both mirror short names and direct URLs.
  • The use command requires a valid mirror short name.

Help

To view detailed help information for each command, run:

pypi <command> -h/--help

For example:

pypi use -h

License

This project is licensed under the MIT License - see the LICENSE file for details.