module pycode.pip_helper

Inheritance diagram of pyquickhelper.pycode.pip_helper

Short summary

module pyquickhelper.pycode.pip_helper

Helpers for pip

Some links to look:

source on GitHub

Classes

class

truncated documentation

Distribution

Common interface for old and recent pip packages.

PQPipError

Any exception raised by one of the following function.

Functions

function

truncated documentation

get_installed_distributions

Directs call to function get_installed_distributions from pip. Return a list of installed Distribution objects. …

get_package_info

Calls pip show to retrieve information about packages.

get_packages_list

calls pip list to retrieve the list of packages

package2dict

Extracts information from a package.

Methods

method

truncated documentation

__getattr__

__init__

__init__

Documentation

Helpers for pip

Some links to look:

source on GitHub

class pyquickhelper.pycode.pip_helper.Distribution(dist)[source]

Bases: object

Common interface for old and recent pip packages.

source on GitHub

__getattr__(attr)[source]
__init__(dist)[source]
exception pyquickhelper.pycode.pip_helper.PQPipError(*args)[source]

Bases: Exception

Any exception raised by one of the following function.

source on GitHub

Parameters

args – either a string 3 strings (cmd, out, err)

source on GitHub

__init__(*args)[source]
Parameters

args – either a string 3 strings (cmd, out, err)

source on GitHub

pyquickhelper.pycode.pip_helper.get_installed_distributions(local_only=True, skip=None, include_editables=True, editables_only=False, user_only=False, use_cmd=False)[source]

Directs call to function get_installed_distributions from pip.

Return a list of installed Distribution objects.

Parameters
  • local_only – if True (default), only return installations local to the current virtualenv, if in a virtualenv.

  • skip – argument is an iterable of lower-case project names to ignore; defaults to pip.compat.stdlib_pkgs (if skip is None)

  • editables – if False, don’t report editables.

  • editables_only – if True , only report editables.

  • user_only – if True , only report installations in the user site directory.

  • use_cmd – if True, use a different process (updated package list)

Returns

list of installed Distribution objects.

source on GitHub

pyquickhelper.pycode.pip_helper.get_package_info(name=None, start=0, end=-1)[source]

Calls pip show to retrieve information about packages.

Parameters
  • name – name of he packages or None to get all of them in a list

  • start – start at package n (in list return by get_packages_list)

  • end – end at package n, -1 for all

Returns

dictionary or list of dictionaries

source on GitHub

pyquickhelper.pycode.pip_helper.get_packages_list()[source]

calls pip list to retrieve the list of packages

source on GitHub

pyquickhelper.pycode.pip_helper.package2dict(pkg)[source]

Extracts information from a package.

Parameters

pkg – type pip._vendor.pkg_resources.Distribution

Returns

dictionary

source on GitHub