sempy_labs.daxlib package

Module contents

sempy_labs.daxlib.add_package_to_semantic_model(dataset: str | UUID, package_name: str, version: str = None, workspace: str | UUID | None = None)

Adds functions from a DAXLib.org package to a semantic model (if the package is not already present).

Parameters:
  • dataset (str | uuid.UUID) – The name or ID of the semantic model (dataset).

  • package_name (str) – The name of the DAXLib.org package.

  • version (str, default=None) – The version of the package. If None, the latest version is used.

  • workspace (str | uuid.UUID, default=None) – The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

sempy_labs.daxlib.get_package_functions(package_name: str, version: str = None) List[Dict[str, str]]

Gets the list of functions from a DAXLib.org package.

Parameters:
  • package_name (str) – The name of the DAXLib.org package.

  • version (str, default=None) – The version of the package. If None, the latest version is used.

Returns:

A list of functions with ‘name’ and ‘definition’.

Return type:

List[Dict[str, str]]

sempy_labs.daxlib.get_package_tmdl(package_name: str, version: str = None) str

Gets the TMDL of a DAXLib.org package.

Parameters:
  • package_name (str) – The name of the DAXLib.org package.

  • version (str, default=None) – The version of the package. If None, the latest version is used.

Returns:

The TMDL content of the package.

Return type:

str

sempy_labs.daxlib.remove_package_from_semantic_model(dataset: str | UUID, package_name: str, version: str = None, workspace: str | UUID | None = None)

Removes functions from a DAXLib.org package from a semantic model.

Parameters:
  • dataset (str | uuid.UUID) – The name or ID of the semantic model (dataset).

  • package_name (str) – The name of the DAXLib.org package.

  • version (str, default=None) – The version of the package. If None, the latest version is used.

  • workspace (str | uuid.UUID, default=None) – The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

sempy_labs.daxlib.update_package_in_semantic_model(dataset: str | UUID, package_name: str, version: str = None, workspace: str | UUID | None = None)

Updates functions from a DAXLib.org package in a semantic model to a specific version of the package (defaults to latest version).

Parameters:
  • dataset (str | uuid.UUID) – The name or ID of the semantic model (dataset).

  • package_name (str) – The name of the DAXLib.org package.

  • version (str, default=None) – The version of the package. If None, the latest version is used.

  • workspace (str | uuid.UUID, default=None) – The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.