API Reference¶
Freeze¶
-
pip2.commands.freeze.
freeze
()¶ Get a list of installed projects.
Returns a dictionary where the keys are project names and the values are dictionaries with the following keys and values:
- ‘version’ - a string containing the project’s version.
For example, the return value may look like this:
{ 'TowelStuff': {'version': '0.1.1'}, 'pip2': {'version': '1.0'}}
Return type: dictionary
Install¶
-
pip2.commands.install.
install
(project_list)¶ Install a list of projects.
Note that project dependencies are not yet detected and installed.
Returns a dictionary with the following keys and values:
- ‘installed’ - a list of strings containing the projects that were successfully installed.
- ‘failed’ - a list of strings containing the projects that failed to install.
Parameters: project_list (iterable of strings) – the projects to install. May be names of projects on the Python Package Index (PyPI) or paths to local directories and archives (.zip, .tar.gz, .tar.bz2, .tgz, or .tar). Return type: dictionary
Search¶
-
pip2.commands.search.
search
(query)¶ Search projects on the Python Package Index (PyPI).
Searches the name and summary fields for projects that match query.
Returns a dictionary containing the search results. The keys are project names and the values are dictionaries with the following keys and values:
- ‘summary’ - a string containing the project’s summary.
- ‘installed_version’ (only present if the project is installed) - a string containing the version of the project currently installed.
- ‘latest_version’ (only present if the project is installed) - a string containing the latest version of the project available on the index.
For example, the return value may look like this:
{ 'TowelStuff': { 'installed_version': '0.1.1', 'latest_version': '0.1.1', 'summary': 'Useful towel-related stuff.'}, 'towel': {'summary': 'Keeping you DRY since 2010'}}
Parameters: query (string) – the search query. Return type: dictionary
Uninstall¶
-
pip2.commands.uninstall.
uninstall
(project_list)¶ Uninstall a list of projects.
Returns a dictionary with the following keys and values:
- ‘uninstalled’ - a list of strings containing the names of the projects that were successfully uninstalled.
- ‘failed’ - a list of strings containing the names of the projects that failed to uninstall.
Parameters: project_list (iterable of strings) – the names of the projects to uninstall. Return type: dictionary