Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.commands Namespace Reference

Namespaces

namespace  cache
 
namespace  check
 
namespace  completion
 
namespace  configuration
 
namespace  debug
 
namespace  download
 
namespace  freeze
 
namespace  hash
 
namespace  help
 
namespace  index
 
namespace  inspect
 
namespace  install
 
namespace  list
 
namespace  search
 
namespace  show
 
namespace  uninstall
 
namespace  wheel
 

Functions

Command create_command (str name, **Any kwargs)
 
Optional[str] get_similar_commands (str name)
 

Variables

 CommandInfo = namedtuple("CommandInfo", "module_path, class_name, summary")
 
dict commands_dict
 

Detailed Description

Package containing all pip commands

Function Documentation

◆ create_command()

Command create_command ( str  name,
**Any  kwargs 
)
Create an instance of the Command class with the given name.

Definition at line 109 of file __init__.py.

109def create_command(name: str, **kwargs: Any) -> Command:
110 """
111 Create an instance of the Command class with the given name.
112 """
113 module_path, class_name, summary = commands_dict[name]
114 module = importlib.import_module(module_path)
115 command_class = getattr(module, class_name)
116 command = command_class(name=name, summary=summary, **kwargs)
117
118 return command
119
120
for i

References i.

◆ get_similar_commands()

Optional[str] get_similar_commands ( str  name)
Command name auto-correct.

Definition at line 121 of file __init__.py.

121def get_similar_commands(name: str) -> Optional[str]:
122 """Command name auto-correct."""
123 from difflib import get_close_matches
124
125 name = name.lower()
126
127 close_commands = get_close_matches(name, commands_dict.keys())
128
129 if close_commands:
130 return close_commands[0]
131 else:
132 return None

References i.

Variable Documentation

◆ CommandInfo

CommandInfo = namedtuple("CommandInfo", "module_path, class_name, summary")

Definition at line 11 of file __init__.py.

◆ commands_dict

dict commands_dict

Definition at line 20 of file __init__.py.