profile_manager.profiles.utils module

profile_manager.profiles.utils.define_plugin_version_from_metadata(manager_metadata: Dict[str, Any], plugin_metadata: Dict[str, Any]) → str[source]

Define plugin version from available metadata

Parameters:
  • manager_metadata (Dict[str, Any]) – QGIS plugin manager metadata

  • plugin_metadata (Dict[str, Any]) – installed plugin metadata

Returns:

plugin version

Return type:

str

profile_manager.profiles.utils.get_current_profile_name() → str[source]

Get name of the profile used by the current QGIS session.

Returns:

current profile name

Return type:

str

profile_manager.profiles.utils.get_installed_plugin_list(profile_name: str, only_activated: bool = True) → List[str][source]

Get installed plugin for a profile

Parameters:
  • profile_name (str) – profile name

  • only_activated (bool, optional) – True to get only activated plugin, False to get all installed plugins. Defaults to True.

Returns:

plugin slug name list

Return type:

List[str]

profile_manager.profiles.utils.get_installed_plugin_metadata(profile_name: str, plugin_slug_name: str) → Dict[str, Any][source]

Get metadata information from metadata.txt file in profile installed plugin

Parameters:
  • profile_name (str) – profile name

  • plugin_slug_name (str) – plugin slug name

Returns:

metadata as dict. Empty dict if metadata unavailable

Return type:

Dict[str, Any]

profile_manager.profiles.utils.get_plugin_info_from_qgis_manager(plugin_slug_name: str, reload_manager: bool = False) → Dict[str, str] | None[source]

Get plugin informations from QGIS plugin manager

Parameters:
  • plugin_slug_name (str) – _description_

  • reload_manager (bool, optional) – reload manager for new plugins. Defaults to False.

Returns:

metadata from plugin manager, None if plugin not found

Return type:

Optional[Dict[str, str]]

profile_manager.profiles.utils.get_plugin_repository_url(manager_metadata: Dict[str, Any]) → str | None[source]

Get plugins.xml URL of the repository a plugin was installed from.

Only repositories known by the current QGIS session are available.

Parameters:

manager_metadata (Dict[str, Any]) – metadata from QGIS plugin manager

Returns:

repository URL, None for plugins not related to a repository

Return type:

Optional[str]

profile_manager.profiles.utils.get_profile_name_list() → List[str][source]

Get profile name list from current installed QGIS

Returns:

profile name list

Return type:

List[str]

profile_manager.profiles.utils.get_profile_plugin_information(profile_name: str, plugin_slug_name: str) → QdtPluginInformation | None[source]

Get plugin information from profile, whatever the repository it was installed from (official, third-party or none).

Parameters:
  • profile_name (str) – profile name

  • plugin_slug_name (str) – plugin slug name

Returns:

plugin information, None if the plugin is

neither known by the QGIS plugin manager nor has readable metadata in the profile

Return type:

Optional[QdtPluginInformation]

profile_manager.profiles.utils.get_profile_plugin_list_information(profile_name: str, only_activated: bool = True) → List[QdtPluginInformation][source]

Get profile plugin information

Parameters:
  • profile_name (str) – profile name

  • only_activated (bool, optional) – True to get only activated plugin, False to get all installed plugins. Defaults to True.

Returns:

list of plugin information

Return type:

List[QdtPluginInformation]

profile_manager.profiles.utils.get_profile_plugin_metadata_path(profile_name: str, plugin_slug_name: str) → Path[source]

Get path to metadata.txt for a plugin inside a profile

Parameters:
  • profile_name (str) – profile name

  • plugin_slug_name (str) – plugin slug name

Returns:

metadata.txt path

Return type:

Path

profile_manager.profiles.utils.get_profile_qgis_ini_path(profile_name: str) → Path[source]

Get QGIS3.ini file path for a profile

Parameters:

profile_name (str) – profile name

Returns:

QGIS3.ini path

Return type:

Path

profile_manager.profiles.utils.qgis_profiles_path() → Path[source]

Get QGIS profiles paths from current QGIS application

Returns:

QGIS profiles path

Return type:

Path