paidiverpy.utils.locals#

This module have functions related to package versions.

Functions#

get_sys_info(→ list[tuple[str, str]])

Returns system information as a dict.

cli_version(→ str)

Get the version of a CLI tool.

pip_version(→ str)

Get the version of a package installed via pip.

get_version(→ str)

Get the version of a module.

show_versions(→ None)

Print the versions of paidiverpy and its dependencies.

Module Contents#

paidiverpy.utils.locals.get_sys_info() list[tuple[str, str]][source]#

Returns system information as a dict.

Returns:

A list of tuples containing system information.

Return type:

list[tuple[str, str]]

paidiverpy.utils.locals.cli_version(cli_name: str) str[source]#

Get the version of a CLI tool.

Parameters:

cli_name (str) – The name of the CLI tool.

Returns:

The version of the CLI tool.

Return type:

str

paidiverpy.utils.locals.pip_version(pip_name: str) str[source]#

Get the version of a package installed via pip.

Parameters:

pip_name (str) – The name of the package.

Returns:

The version of the package.

Return type:

str

paidiverpy.utils.locals.get_version(module_name: str) str[source]#

Get the version of a module.

Parameters:

module_name (str) – The name of the module.

Returns:

The version of the module.

Return type:

str

paidiverpy.utils.locals.show_versions(file: TextIO = sys.stdout, conda: bool = False) None[source]#

Print the versions of paidiverpy and its dependencies.

Parameters:
  • file (TextIO, optional) – The file to write the versions to. Defaults to sys.stdout.

  • conda (bool, optional) – Whether to format the output for conda. Defaults to False.