pip facts¶
- class reemote.facts.pip.get_packages.Get_packages[source]¶
Bases:
objectReturns a dictionary of installed packages.
Examples:
yield Get_packages()
- reemote.facts.pip.get_packages.parse_pip_list_installed(output)[source]¶
Parses the stdout from ‘pip list’ into a list of packages.
This function processes the raw string output from the pip list command. It skips the header lines and parses each subsequent line to extract the package name and its version.
The function is designed to handle the specific two-column format of the pip list command, correctly separating the package name from the version string.
- Parameters:
output (str) – The raw string output from a pip list command.
- Returns:
A list of dictionaries, where each dictionary contains the ‘name’ and ‘version’ of an installed package.
- Return type:
list[dict]