Dimension

A highly optimized class for fast dimensional hierarchy operations

analyze.dimension.add_alias(project_id, name, alias)

Adds a new alias

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • alias (str) – Alias unique ID

Returns

None

analyze.dimension.add_alt_hierarchy(project_id, name, hierarchy)

Creates a new alt hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchy (str) – Alternate hierarchy key

Returns

None

analyze.dimension.add_dimension(project_id, duid, name)

Creates a new dimension

Parameters
  • project_id (str) – Unique project identifier

  • duid (str) – Dimension key

  • name (str) – Dimension name

Returns

None

analyze.dimension.add_label(project_id, dimension_id, label)

Sets a label on a dimension :param project_id: Unique project identifier :type project_id: str :param dimension_id: Unique dimension identifier :type dimension_id: str :param label: The label unique name :type label: str

Returns

None

analyze.dimension.add_mapping(project_id, name, table, column)

Adds a new table column mapping

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Dimension unique ID

  • table (str) – Table name

  • column (str) – Column name

Returns

None

analyze.dimension.add_node(project_id, name, parent, child, consolidation='+', hierarchy=MAIN, before=None, after=None)

Adds an existing main hierarchy node to the specified hierarchy both leaves and folders can be added to the hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – parent node key

  • child (str) – child node key

  • consolidation (str) – Consolidation Type (+, -, or ~)

  • hierarchy (str) – Hierarchy unique ID

  • before (str) – node to insert before

  • after (str) – node to insert after

Returns

None

analyze.dimension.add_nodes(project_id, name, parent, children, consolidation='+', hierarchy=MAIN, before=None, after=None)

Adds an existing main hierarchy nodes to the specified hierarchy both leaves and folders can be added to the hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – parent node key

  • children (list) – child node keys

  • consolidation (str) – Consolidation Type (+, -, or ~)

  • hierarchy (str) – Hierarchy unique ID

  • before (str) – node to insert before

  • after (str) – node to insert after

Returns

None

analyze.dimension.add_path(project_id, dimension_id, path)

Adds a dimension reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

  • path (str) – Object rollup path using unix style forward slashes

Returns

None

analyze.dimension.add_paths(project_id, additions)

Adds multiple dimension reference paths in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • additions (list) – List of moves, containing: dimension_id (str): Unique dimension identifier to_path (str): New path

Returns

None

analyze.dimension.add_property(project_id, name, property, type=None, display=None, role=None, config=None)

Adds a new property

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • property (str) – Property unique ID

  • type (str) – property type for data editor

  • display (str) – property display option

  • role (str) – role in allocations (if dimensions is used this way)

  • config (dict) – property config for a type

Returns

None

analyze.dimension.add_value(project_id, name, value)

Adds a new value

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • value (str) – Value unique ID

Returns

None

analyze.dimension.ascend(project_id, name, node, hierarchy=MAIN, alias=None)

Ascends hierarchy from node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Node alias name

  • hierarchy (str) – Hierarchy unique ID

  • alias (str) – Alias type

Returns

List of lists

(int): of node generation (str): node unique identifier

Return type

List

analyze.dimension.backup(project_id, name)

Backup dimension in project

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Dimension key

Returns

Dimension persisted in YAML format

Return type

yaml (str)

analyze.dimension.backup_all(project_id)

Backup dimension in project

Parameters

project_id (str) – Unique project identifier

Returns

Dimensions persisted in YAML format

Return type

yaml (str)

analyze.dimension.backup_all_to_document(project_id, document_account, path, file_name)

Backup dimensions in project to document store

Parameters
  • project_id (str) – Unique project identifier

  • document_account (str) – The ID of the document account to upload to

  • path (str) – The path in document to upload to

  • file_name (str) – The name to upload the result file as

Returns

None

analyze.dimension.backup_to_document(project_id, name, document_account, path, file_name)

Backup dimension in project to document store

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Dimension key

  • document_account (str) – The ID of the document account to upload to

  • path (str) – The path in document to upload to

  • file_name (str) – The name to upload the result file as

Returns

None

analyze.dimension.clear(project_id, name)

Clears the main and alternate hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

None

analyze.dimension.clear_alt_hierarchy(project_id, name, hierarchy)

Clears an alt hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchy (str) – Alternate hierarchy unique ID

Returns

None

analyze.dimension.clone_node(project_id, name, parent, child, hierarchy=MAIN)

Creates a new node based on the node provided and inserts it below the given node at the same level

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – parent node key

  • child (str) – child node key

  • hierarchy (str, optional) – Hierarchy unique ID

Returns

Unique node identifier of the cloned node

Return type

str

analyze.dimension.copy_dimension(project_id, src, dest, dest_project_id=None)

Copies a dimension

Parameters
  • project_id (str) – Unique project identifier

  • src (str) – Current dimension unique ID

  • dest (str) – New dimension unique ID

  • dest_project_id (str) – Analyze project_id used as key to saved hierarchy

Returns

None

analyze.dimension.copy_directory(project_id, from_path, to_path)

Copies a folder and all paths in the hierarchy but does not duplicate referenced objects

Parameters
  • project_id (str) – Unique project identifier

  • from_path (str) – Original directory path

  • to_path (str) – Destination directory path

Returns

None

analyze.dimension.create(project_id, path, name, memo)

Creates a Dimension

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to place the dimension in the hierarchy

  • name (str) – The object name

  • memo (str) – The object description

Returns

dict with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique dimension identifier

  • name (str): Dimension Name

  • memo (str): Description of dimension

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

dict

analyze.dimension.create_directory(project_id, path)

Creates a folder in the dimension hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

Returns

None

analyze.dimension.create_directory_paths(project_id, path)

Creates all necessary folders in the path in the dimension hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

Returns

None

analyze.dimension.delete(project_id, dimension_id)

Deletes a dimension

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

Returns

None

analyze.dimension.delete_alias(project_id, name, alias)

Delete an alias

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • alias (str) – Alias unique ID

Returns

None

analyze.dimension.delete_alt_hierarchy(project_id, name, hierarchy)

Deletes an alt hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchy (str) – Alternate hierarchy unique ID

Returns

None

analyze.dimension.delete_dimension(project_id, name)

Deletes a dimension

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Dimension key

Returns

None

analyze.dimension.delete_directory(project_id, path)

Deletes a folder and removes path from all objects in that directory

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

Returns

None

analyze.dimension.delete_mapping(project_id, table, column)

Deletes a table column mapping

Parameters
  • project_id (str) – Unique project identifier

  • table (str) – Table name

  • column (str) – Column name

Returns

None

analyze.dimension.delete_node(project_id, name, parent, child, hierarchy=MAIN)

Deletes the node and removes all aliases and properties

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – parent node key

  • child (str) – child node key

  • hierarchy (str) – Hierarchy unique ID

Returns

None

analyze.dimension.delete_node_alias(project_id, name, node, alias)

Creates a new node alias

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • alias (str) – Alias ID

Returns

None

analyze.dimension.delete_node_property(project_id, name, node, property)

Delete a property

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • property (str) – Property type

Returns

None

analyze.dimension.delete_node_value(project_id, name, node, value)

Deletes a node value

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • value (str) – Value name

Returns

None

analyze.dimension.delete_nodes(project_id, name, parent, child, hierarchy=MAIN)

Deletes the nodes and removes all aliases and properties

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – parent node key

  • children (str) – child node key

  • hierarchy (str) – Hierarchy unique ID

Returns

None

analyze.dimension.delete_property(project_id, name, property)

Delete an property

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • property (str) – Property unique ID

Returns

None

analyze.dimension.delete_value(project_id, name, value)

Delete an value

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • value (str) – Value unique ID

Returns

None

analyze.dimension.descend(project_id, name, node, hierarchy=MAIN, alias=None)

Descends hierarchy from node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Node alias name

  • hierarchy (str) – Hierarchy unique ID

  • alias (str) – Alias type

Returns

List of lists

(int): of node generation (str): node unique identifier

Return type

List

analyze.dimension.dimension(project_id, dimension_id, keys=None))

Provides detailed dimension information

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

  • keys (list) – List of keys to return. Defaults to all.

Returns

dict with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique dimension identifier

  • name (str): Dimension Name

  • memo (str): Description of dimension

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

dict

analyze.dimension.dimension_table(project_id, name)

All Dimension Hierarchy data flattened into a dict of dataframes :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str

Returns

Dict of Dataframes with hierarchy data
  • hierarchically sorted nodes

  • attributes/aliases/properties/values appended as columns

Return type

dict

analyze.dimension.dimensions(project_id, id_filter=None, sort=None, keys=None, member_details=False)

Returns the list of dimensions in the specified project

Parameters
  • project_id (str) – Unique project identifier

  • id_filter (list, optional) – List of identifiers to which to limit the results. If None or empty, don’t filter

  • sort (list, optional) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list, optional) – List of keys to return. Defaults to all.

  • member_details (bool, optional) – If True then returns member info relating to updated_by

Returns

result list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique dimension identifier

  • name (str): Dimension Name

  • memo (str): Description of dimension

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

If member_details is set to True, the dict will also contain:
  • updated_by_full_name (str): The User Name of the user that last updated the dimension

  • updated_by_user_id (int): The id of the user that last updated the dimension

  • updated_by_gravatar_hash (str): Unique hash to pull gravatar for the user.

Return type

list

analyze.dimension.dimensions_from_label(project_id, label, sort=None, keys=None)

Provides list of dimensions for based on set of labels. Uses AND condition. :param project_id: Unique project identifier :type project_id: str :param label: label name :type label: str :param sort: List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)] :type sort: list :param keys: List of keys to return. Defaults to all. :type keys: list

Returns

result list of dicts with the following properties
  • project_id (str): Unique project identifier

  • branch (str): Project branch

  • id (str): Unique dimension identifier

  • name (str): Dimension Name

  • memo (str): Description of dimension

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.dimension.dimensions_from_path(project_id, path, sort=None, keys=None)

Provides list of dimensions based on a path fragment. Path fragment can be to parent level.

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Object rollup path using unix style forward slashes

  • sort (list) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list) – List of keys to return. Defaults to all.

Returns

result list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique dimension identifier

  • name (str): Dimension name

  • memo (str): Description of dimension

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

Return type

list

analyze.dimension.flashback_backup(project_id, dimension_id)

Schedules a backup of the dimension

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

Returns

None

analyze.dimension.flashback_dimensions(project_id)

Provides list of dimensions stored in flashback

Parameters

project_id (str) – Unique project identifier

Returns

List of dimensions

Return type

list

analyze.dimension.flashback_hold(project_id, dimension_id, version_id)

Puts a hold on a version to prevent lifecycle cleanup after retention period

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

  • version_id (str) – Version of the dimension to hold

Returns

None

analyze.dimension.flashback_release(project_id, dimension_id, version_id)

Releases a hold on a version to allow lifecycle cleanup after retention period

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

  • version_id (str) – Version of the dimension to release

Returns

None

analyze.dimension.flashback_restore(project_id, dimension_id, version_id, target_dimension_id)

Restores dimension data to the target dimension specified

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

  • version_id (str) – Version of the dimension to restore

  • target_dimension_id (str) – Target dimension UUID

Returns

None

analyze.dimension.flashback_restore_project(project_id)

Schedules a restore of all dimensions in the project to their latest version stored

Parameters

project_id (str) – Unique project identifier

Returns

None

analyze.dimension.flashback_versions(project_id, dimension)

Provides list of versions of the dimension

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

Returns

List of dimension versions

Return type

list

analyze.dimension.get_aliases(project_id, name)

Returns current alias names

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

Set of aliases types

Return type

set

analyze.dimension.get_aliases_dataframe(project_id, name)

Get aliases as a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str

Returns

Dataframe with alias nodes and values

Return type

df (Dataframe)

analyze.dimension.get_all_aliases(project_id, name)

Return all aliases in dimension

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

Dict of dicts by alias name/node/alias

Return type

dict

analyze.dimension.get_all_attributes(project_id, name)

Returns all attributes in dimension

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

Dict of dicts by hierarchy/node/parent atrribute

Return type

dict

analyze.dimension.get_all_inherited_attributes(project_id, name)

Returns all attributes including inherited attributes in dimension

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

Dict of dicts - node (str): Unique hierarchy node identifier - attribute (str): Attribute - hierarchy (str): Hierarchy unique ID - inherited (bool): Inherited value returned - ancestor (str): Node holding inherited attribute

Return type

dict

analyze.dimension.get_all_leaves(project_id, name, hierarchy=MAIN)

Returns all leaf nodes in hierarchy :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param hierarchy: Hierarchy unique ID :type hierarchy: str

Returns

Set of all node names

Return type

set

analyze.dimension.get_all_nodes(project_id, name, hierarchy=None)

Returns all nodes used in dimension or hierarchy :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param hierarchy: Hierarchy unique ID or None returns all dim nodes :type hierarchy: str

Returns

Set of all node names

Return type

set

analyze.dimension.get_all_parents(project_id, name, hierarchy=MAIN)

Returns all parents nodes in hierarchy :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param hierarchy: Hierarchy unique ID :type hierarchy: str

Returns

Set of all node names

Return type

set

analyze.dimension.get_all_properties(project_id, name, inherit=False, hierarchy=None)

Returns all properties including inherited properties in dimension

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • inherit (bool) – Find inherited property

  • hierarchy (str) – Hierarchy unique ID or None returns all hierarchies

Returns

Dict of dicts by hierarchy
  • node (str): Unique hierarchy node identifier

  • property(str): Property type

  • value (str): Value or None

  • inherited (bool): Inherited value returned

  • ancestor (str): Node holding inherited value

Return type

dict

analyze.dimension.get_all_values(project_id, name)

Return all values in dimension

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

Dict of dicts by value name/node/value

Return type

dict

analyze.dimension.get_alt_hierarchies(project_id, name)

Returns current alt hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

List of alternate hierarchies

Return type

list

analyze.dimension.get_ancestor_at_generation(project_id, name, node, generation, hierarchy=MAIN)

Traverses up the hierarchy to find the specified ancestor

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • generation (int) – Number of generations to traverse for ancestor

  • hierarchy (str) – Hierarchy unique ID

Returns

Ancestor node unique identifier

Return type

str

analyze.dimension.get_ancestor_at_level(project_id, name, node, level, hierarchy=MAIN)

Traverses up the hierarchy to find the specified ancestor

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • level (int) – Number of levels to go back for ancestor

  • hierarchy (str) – Hierarchy unique ID

Returns

Ancestor node unique identifier

Return type

str

analyze.dimension.get_ancestors(project_id, name, node, hierarchy=MAIN)

Returns an ordered list of the node lineage objects

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

List of nodes

Return type

list

analyze.dimension.get_attributes_dataframe(project_id, name)

Get attributes as a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str

Returns

Dataframe with attribute nodes and values

Return type

df (Dataframe)

analyze.dimension.get_bottom(project_id, name, node, hierarchy=MAIN)

Returns the bottom node of the children in the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

Unique node identifier

Return type

str

analyze.dimension.get_children(project_id, name, node, hierarchy=MAIN)

Finds the children of the node within the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

List of child node unique identifiers

Return type

list

analyze.dimension.get_children_count(project_id, name, node, hierarchy=MAIN)

Finds number of children of the node within the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

Count of child node unique identifiers

Return type

int

analyze.dimension.get_children_for_ui(project_id, name, node_id, hierarchy=MAIN)

Finds the children of the node within the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

List of child node unique identifiers

Return type

list

analyze.dimension.get_children_with_details(project_id, name, node, hierarchy=MAIN)

Finds the children of the node within the specified hierarchy and returns additonal details

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

List of dicts with child node unique identifiers/consolidations/leaf

Return type

list

analyze.dimension.get_consolidation(project_id, name, node, hierarchy=MAIN)

Gets the consolidation type of a node within the specified alt hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent node ID

  • child (str) – Child node ID

  • hierarchy (str) – Hierarchy unique ID

Returns

Consolidation type of node (‘~’, ‘+’, ‘-‘, ‘|’, ‘&’)

~ = None + = Add - = Subtract | = OR & = AND

Return type

str

analyze.dimension.get_consolidation_dataframe(project_id, name, value, hierarchy=MAIN)

Returns consolidated values for nodes in hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • value (str) – Value name to process

  • hierarchy (str) – Hierarchy unique ID to process

Returns

Dataframe with hierarchy plus input values & consolidated values

Return type

df (Dataframe)

analyze.dimension.get_default_aliases(auth_id, project_id, name)

Adds a new alias

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • alias (str) – Alias unique ID

Returns

Primary alias unique ID

secondary (str): Secondary alias unique ID

Return type

dict - primary (str)

analyze.dimension.get_descendents(project_id, name, node, hierarchy=MAIN)

Finds all descendants of the node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

List of descendent node unique identifiers

Return type

list

analyze.dimension.get_descendents_at_generation(auth_id, project_id, name, node, generation, hierarchy=plaid.app.analyze.utility.dimension.MAIN)

get_descendents_at_level(project_id, name, node, level, hierarchy=MAIN) Finds all node types of a branch at the specified level

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • generation (int) – Number of generations to descend for leaves

  • hierarchy (str) – Hierarchy unique ID

Returns

List of node unique identifiers at the specified level

Return type

list

analyze.dimension.get_difference(project_id, name, hierarchies)

Difference of nodes between main and alternate hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchies (list) – list of alternate hierarchies to use

Returns

Difference of all nodes across hierarchies

Return type

list

analyze.dimension.get_dimension_tables(project_id, name)

Return tables using the dimension in a column mapping

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Dimension unique ID

Returns

Dict of tables & columns

Return type

dict

analyze.dimension.get_dimensions(project_id)

Gets dimensions

Parameters

project_id (str) – Unique project identifier

Returns

Set of dimensions

Return type

set

analyze.dimension.get_down(project_id, name, parent, child, hierarchy=MAIN)

Returns the next node of the children in the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent Node Key

  • child (str) – Child Node Key

  • hierarchy (str) – Hierarchy unique ID

Returns

Unique node identifier

Return type

str

analyze.dimension.get_generation(project_id, name, node, hierarchy=MAIN)

Returns the generation of the node in the main hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

Generation of node

Return type

int

analyze.dimension.get_grandparent(project_id, name, node, hierarchy=MAIN)

Returns the grandparent of the node within the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

Grandparent node

Return type

str

analyze.dimension.get_hierarchy(project_id, name, node='!!root!!', hierarchy=MAIN, alias=None, generation=None, leaf_only=False)

Returns the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

  • alias (str) – Alias unique ID

  • generation (int) – Generation to descend to or None for all

  • leaf_only (bool) – Only return leaf nodes no parents

Returns

Hierarchy from specified node with node details

Return type

dict

analyze.dimension.get_hierarchy_dataframe(project_id, name, hierarchy=MAIN)

Get attributes as a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param hierarchy: Hierarchy unique ID :type hierarchy: str

Returns

Dataframe with hierarchy data

Return type

df (Dataframe)

analyze.dimension.get_intersection(project_id, name, main_node, alt_nodes)

Intersection of nodes between main and alternate hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchies (list) – list of alternate hierarchies to use

Returns

Intersection of all nodes across hierarchies

Return type

list

analyze.dimension.get_leaf_position(project_id, name, origin_node, target_node, hierarchy=MAIN)

Gets the leaf position of the target_node relative to the origin_node, as if in an ordered list of all leaves. Will be negative if the target_node is before the origin_node, positive if the target_node is after the origin_node.

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • origin_node (str) – Unique hierachy node identifier for the node to measure from

  • target_node (str) – Unique hierarchy node identifier for the node to measure to

  • hierarchy (str) – Hierarchy unique ID

Returns

the leaf position of the target node relative to the origin node

Return type

int

analyze.dimension.get_leaves(project_id, name, node, hierarchy=MAIN)

Finds the leaves below a node within a specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

List of leaf level node objects

Return type

list

analyze.dimension.get_leaves_at_generation(project_id, name, node, generation, hierarchy=MAIN)

Finds leaves of a branch at the specified generation

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • generation (int) – Number of generations to descend for leaves

  • hierarchy (str) – Hierarchy unique ID

Returns

List of leaf generation node objects

Return type

list

analyze.dimension.get_leaves_at_level(project_id, name, node, level, hierarchy=MAIN)

Finds leaves of a branch at the specified level

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • level (int) – Number of levels to ascend for leaves

  • hierarchy (str) – Hierarchy unique ID

Returns

List of leaf level node objects

Return type

list

analyze.dimension.get_node_alias(project_id, name, node, alias)

Gets an alias for the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • alias (str) – Alias type

Returns

Alias of node

Return type

str

analyze.dimension.get_node_by_leaf_position(project_id, name, origin_node, hierarchy=MAIN)

Gets a leaf node by relative position to an origin leaf node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • origin_node (str) – Unique hierarchy identifier for the node to measure from

  • leaf_position (str) – the relative position from the origin_node to look for a result node

  • hierarchy (str) – Hierarchy unique ID

Returns

The leaf node that is N steps away from the origin_node, when

considering all leaf nodes in order, where N is leaf_position. Negative leaf_position means the result will be earlier in that order than the origin_node, while positive leaf_position means the result will be later in that order than the origin_node.

Return type

str

analyze.dimension.get_node_count(project_id, name, hierarchy=MAIN)

Provides number of hierarchy nodes

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchy (str) – Hierarchy unique ID

Returns

Node count

Return type

int

analyze.dimension.get_node_details(project_id, name, node, hierarchy=MAIN)

Returns detailed information about a node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

Dict with child node unique identifiers/consolidations/leaf/aliases etc.

Return type

dict

analyze.dimension.get_node_from_alias(project_id, name, alias, value)

Finds the node object using the alias

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • alias (str) – Alias type

  • value (str) – Alias of node

Returns

Node name

Return type

str

analyze.dimension.get_node_property(project_id, name, node, property, inherit=False, hierarchy=MAIN)

Gets a property for the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • property (str) – Property type

  • inherit (bool) – Find inherited property

  • hierarchy (str) – Hierarchy unique ID

Returns

  • node (str): Unique hierarchy node identifier

  • property(str): Property type

  • value (str): Value or None

  • inherited (bool): Inherited value returned

  • ancestor (str): Node holding inherited value

Return type

dict

analyze.dimension.get_node_value(project_id, name, node, value)

Get value for the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • value (str) – Value name

Returns

Value of node for specified value name

Return type

float

analyze.dimension.get_nodes_from_property(project_id, name, property, value)

Finds the node objects using the property

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • property (str) – Property type

  • value (str) – Property value

Returns

Node names

Return type

list

analyze.dimension.get_nodes_from_value(project_id, name, value, number)

Finds the node objects using the value

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • value (str) – Property type

  • number (float) – Property value

Returns

Node names

Return type

list

analyze.dimension.get_parent(project_id, name, node, hierarchy=MAIN)

Gets the node’s parent within the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

Parent node

Return type

str

analyze.dimension.get_parents(project_id, name, node)

Finds all the hierarchy parents of the node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

Returns

List of hierarchies list: List of alt parent objects

Return type

list

analyze.dimension.get_properties(project_id, name)

Displays the list of current properties

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

Set of current property types

Return type

set

analyze.dimension.get_properties_dataframe(project_id, name)

Get properties as a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str

Returns

Dataframe with property nodes and values

Return type

df (Dataframe)

analyze.dimension.get_properties_with_config(project_id, name)

Returns a list of current properties and their configurations, each as a dict

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

List of property dicts

Return type

list

analyze.dimension.get_property_config(project_id, name, property)

Get the config for the property

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • property (str) – Property unique ID

Returns

type: JSON config

Return type

dict

analyze.dimension.get_siblings(project_id, name, node, hierarchy=MAIN)

Finds the siblings of the node within the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

List of sibling node objects including current node

Return type

list

analyze.dimension.get_table_dimensions(project_id, table)

Return dimensions used by a table in column mappings

Parameters
  • project_id (str) – Unique project identifier

  • table (str) – Table name

Returns

Dict of columns to dimensions

Return type

dict

analyze.dimension.get_top(project_id, name, node, hierarchy=MAIN)

Returns the top node of the children in the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

Unique node identifier

Return type

str

analyze.dimension.get_union(project_id, name, hierarchies)

Union of nodes between main and alternate hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchies (list) – list of alternate hierarchies to use

Returns

Union of all nodes across hierarchies

Return type

list

analyze.dimension.get_up(project_id, name, parent, child, hierarchy=MAIN)

Returns the previous node of the children in the specified hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent Node Key

  • child (str) – Child Node Key

  • hierarchy (str) – Hierarchy unique ID

Returns

Unique node identifier

Return type

str

analyze.dimension.get_values(project_id, name)

Displays the list of current values

Parameters
  • project_id (str) – Unique value identifier

  • name (str) – Unique name for hierarchy dimension

Returns

Set of current value types

Return type

set

analyze.dimension.get_values_dataframe(project_id, name)

Get values as a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str

Returns

Dataframe with values nodes and values

Return type

df (Dataframe)

analyze.dimension.hierarchy_table(auth_id, project_id, name, hierarchy=MAIN)

Hierarchy data flattened into a dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param hierarchy: Hierarchy unique ID :type hierarchy: str

Returns

Dataframe with hierarchy data
  • hierarchically sorted nodes

  • attributes/aliases/properties/values appended as columns

Return type

df (Dataframe)

analyze.dimension.ids_from_path(project_id, path)

Provides the canonical id for the from a provided path

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Object rollup path using unix style forward slashes

Returns

id (str): Dimension unique identifier

Return type

list

analyze.dimension.is_alias(project_id, name, alias)

Checks alias exists

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • alias (str) – Alias unique ID

Returns

Does the alias exist

Return type

bool

analyze.dimension.is_below_group(project_id, name, node, group_id, hierarchy=MAIN)

Checks if a node is contained in a group

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • group_id (str) – Group node unique identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

True if node is contained in group

Return type

bool

analyze.dimension.is_bottom(project_id, name, parent, child, hierarchy=MAIN)

Check if node is the bottom child of the parent node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent node ID

  • child (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

True if the child descends from the parent

Return type

bool

analyze.dimension.is_child_of(project_id, name, node, parent, hierarchy=MAIN)

Check if node is a child of the parent node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • parent (str) – Parent node ID

  • hierarchy (str) – Hierarchy unique ID

Returns

True if the child descends from the parent

Return type

bool

analyze.dimension.is_descendent_of(project_id, name, node, ancestor_id, hierarchy=MAIN)

Checks if node is a decendant of an ancestor node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • ancestor_id (str) – Node ID of ancestor

  • hierarchy (str) – Hierarchy unique ID

Returns

True if the node is an ancestor

Return type

bool

analyze.dimension.is_dimension(project_id, name)

Checks that a dimension exists

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Dimension unique ID

Returns

True if the dimension exists

Return type

bool

analyze.dimension.is_hierarchy(project_id, name, hierarchy)

Checks hierarchy exists

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • hierarchy (str) – Alternate hierarchy unique ID

Returns

True if the hierarchy exists

Return type

bool

analyze.dimension.is_leaf(project_id, name, node, hierarchy=MAIN)

Check if node is a leaf node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

Returns

True if the node is a leaf; False if it is not

Return type

bool

analyze.dimension.is_parent(project_id, name, node, hierarchy=MAIN)

Check if node is a parent node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

Returns

True if the node is a parent; False if it is not

Return type

bool

analyze.dimension.is_parent_of(project_id, name, parent, child, hierarchy=MAIN)

Checks if node is a parent of the child node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Unique hierarchy node identifier

  • child (str) – Child node unique identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

True if the child descends from parent

Return type

bool

analyze.dimension.is_property(project_id, name, property)

Checks property exists

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • property (str) – Property unique ID

Returns

Does the property exist

Return type

bool

analyze.dimension.is_top(project_id, name, parent, child, hierarchy=MAIN)

Check if node is the top child of the parent node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent node ID

  • child (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

True if the child descends from the parent

Return type

bool

analyze.dimension.is_value(project_id, name, value)

Checks value exists

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • value (str) – Value unique ID

Returns

Does the value exist

Return type

bool

analyze.dimension.labels(project_id, dimension_id)

Provides a list of labels for the dimension :param project_id: Unique project identifier :type project_id: str :param dimension_id: Unique dimension identifier :type dimension_id: str

Returns

list of labels associated with Dimension

Return type

list

analyze.dimension.load_aliases_from_dataframe(project_id, name, df, nodes, names, values)

Bulk loads aliases from a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param df: Dataframe with P/C nodes :type df: Dataframe :param nodes: Column with node names :type nodes: str :param names: Column with alias names :type names: str :param values: Column with alias values :type values: str

Returns

None

analyze.dimension.load_from_table_flat(project_id, name, table, columns, top=None, consolidations=None, consol_default='+', hierarchy=MAIN)

Bulk loads a dimension from an Analyze table

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • table (str) – Name of table to query

  • top (str) – Top level name to start dimension hierarchy

  • columns (list) – Column names with flattened hierarchy

  • consolidations (str) – Column with consolidations nodes

  • consol_default (str) – consolidation type +, -, or ~

  • hierarchy (str) – alt hierarchy key

Returns

None

analyze.dimension.load_from_table_pc(project_id, name, table, parents, children, consolidations=None, consol_default='+', hierarchy=MAIN)

Bulk loads a dimension from an Analyze table

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • table (str) – Name of table to query

  • parents (str) – Column with parent nodes

  • children (str) – Column with children nodes

  • consolidations (str) – Column with consolidations nodes

  • consol_default (str) – consolidation type +, -, or ~

  • hierarchy (str) – alt hierarchy key

Returns

None

analyze.dimension.load_hierarchy_from_dataframe(project_id, name, df, parents, children, consolidations=None, consol_default='+', hierarchy=MAIN, clear=False)

Bulk loads a hierarchy from a Dataframe

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • df (str) – Unique name for hierarchy dimension

  • parents (str) – Column with parent nodes

  • children (str) – Column with children nodes

  • consolidations (str) – Column with consolidations nodes

  • consol_default (str) – consolidation type ‘~’, ‘+’, ‘-‘, ‘|’, ‘&’

  • hierarchy (str) – alt hierarchy key or column in dataframe

  • clear (bool) – Clear the hierarchy before loading

Returns

  • hierarchy (str): hierarchy ID

  • parent (str): parent node ID

  • child (str): child node ID

  • consolidation (str): consolidation type

  • status (bool): Success True or False

  • code (int): Result code

  • message (str): Message string

Return type

dataframe

analyze.dimension.load_properties_from_dataframe(project_id, name, df, nodes, names, values)

Bulk loads properties from a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param df: Dataframe with P/C nodes :type df: Dataframe :param nodes: Column with node names :type nodes: str :param names: Column with property names :type names: str :param values: Column with property values :type values: str

Returns

None

analyze.dimension.load_values_from_dataframe(project_id, name, df, nodes, names, values)

Bulk loads values from a Dataframe :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param df: Dataframe with P/C nodes :type df: Dataframe :param nodes: Column with node names :type nodes: str :param names: Column with property names :type names: str :param values: Column with property values :type values: str

Returns

None

analyze.dimension.lookup_by_full_path(project_id, path)

Returns ID for path provided

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Object rollup path using unix style forward slashes

Returns

Dimension unique identifier

Return type

str

analyze.dimension.lookup_by_name(project_id, name)

Returns ID for path provided

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique dimension name

Returns

Dimension unique identifier

Return type

str

analyze.dimension.move_directory(project_id, from_path, to_path)

Updates a folder name in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • from_path (str) – Original directory path

  • to_path (str) – Destination directory path

Returns

None

analyze.dimension.move_node(project_id, name, child, new_parent, hierarchy=MAIN, before=None, after=None)

Moves an existing main hierarchy node to the specified hierarchy both leaves and folders can be added to the hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • child (str) – child node key

  • new_parent (str) – new parent node

  • hierarchy (str) – Hierarchy unique ID

  • before (str) – node to insert before

  • after (str) – node to insert after

Returns

New parent of node

Return type

str

analyze.dimension.move_nodes(project_id, name, moves, hierarchy=MAIN, before=None, after=None)

Moves a set of hierarchy nodes to the specified hierarchy both leaves and folders can be added to the hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • moves (list) – list of children to move

  • new_parent (str) – new parent node key

  • hierarchy (str) – Hierarchy unique ID

  • before (str) – node to insert before

  • after (str) – node to insert after

Returns

New parent of node

Return type

str

analyze.dimension.move_path(project_id, dimension_id, from_path, to_path)

Moves a dimension reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

  • from_path (str) – Original path

  • to_path (str) – Destination path

Returns

None

analyze.dimension.move_paths(project_id, moves)

Moves a dimension reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • moves (list) – List of moves, containing: dimension_id (str): Unique dimension identifier from_path (str): Original path to_path (str): Destination path

Returns

None

analyze.dimension.node_exists(project_id, name, node)

Returns if the specified node exists else False

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

Returns

True if node exists

Return type

bool

analyze.dimension.node_in_hierarchy(project_id, name, node, hierarchy)

Returns True if specified node exists in hierarchy else False

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Hierarchy unique ID

Returns

True if node is in specified hierarchy

Return type

bool

analyze.dimension.paths(project_id, path=None)

Provides a list of paths for all dimensions and folders

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Initial path to search

Returns

List of dimension and directory paths

Return type

list

analyze.dimension.paths_from_id(project_id, dimension_id)

Provides a list of paths associated with the canonical id

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

Returns

List of paths that point to the dimension specified

Return type

list

analyze.dimension.reload(project_id, name)

Load nodes and hierarchies

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

Returns

None

analyze.dimension.remove_label(project_id, dimension_id, label)

Removes a label on a dimension :param project_id: Unique project identifier :type project_id: str :param dimension_id: Unique dimension identifier :type dimension_id: str :param label: The label unique name :type label: str

Returns

None

analyze.dimension.remove_path(project_id, dimension_id, path)

Removes a dimension reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

  • path (str) – Object rollup path using unix style forward slashes

Returns

None

analyze.dimension.rename_alias(project_id, name, old, new)

Renames an alias

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • old (str) – Current alias unique ID

  • new (str) – New alias unique ID

Returns

None

analyze.dimension.rename_alt_hierarchy(project_id, name, old, new)

Renames an alt hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • old (str) – Current alternate hierarchy unique ID

  • new (str) – New alternate hierarchy unique ID

Returns

None

analyze.dimension.rename_dimension(project_id, old, new)

Renames a dimension

Parameters
  • project_id (str) – Unique project identifier

  • old (str) – Current dimension unique ID

  • new (str) – New dimension unique ID

Returns

None

analyze.dimension.rename_node(project_id, name, old, new)

Renames the node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • old (str) – Current node unique ID

  • new (str) – New node unique ID

Returns

None

analyze.dimension.rename_property(project_id, name, old, new)

Renames a property

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • old (str) – Current property unique ID

  • new (str) – New property unique ID

Returns

None

analyze.dimension.rename_value(project_id, name, old, new)

Renames a value

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • old (str) – Current value unique ID

  • new (str) – New value unique ID

Returns

None

analyze.dimension.reorder_nodes(project_id, name, ancestor, children, hierarchy=MAIN)

Reorders the nodes under the ancestor

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • ancestor (str) – Current node unique ID

  • children (list) – Node ids in new order

  • hierarchy (str) – Hierarchy unique ID

Returns

None

analyze.dimension.restore(project_id, data)

Restore dimension in project

Parameters
  • project_id (str) – Unique project identifier

  • data (str) – Backup data in YAML format

Returns

None

analyze.dimension.restore_all(project_id, data)

Restore all dimensions in project

Parameters
  • project_id (str) – Unique project identifier

  • data (str) – Dimensions persisted in YAML format

Returns

None

analyze.dimension.restore_all_from_document(project_id, document_account, path, file_name)

Restore all nodes and hierarchies in project

Parameters
  • project_id (str) – Unique project identifier

  • document_account (str) – The ID of the document account to upload to

  • path (str) – The path in document to upload to

  • file_name (str) – The name to upload the result file as

Returns

None

analyze.dimension.restore_from_document(project_id, document_account, path, file_name)

Restore all nodes and hierarchies in project

Parameters
  • project_id (str) – Unique project identifier

  • document_account (str) – The ID of the document account to upload to

  • path (str) – The path in document to upload to

  • file_name (str) – The name to upload the result file as

Returns

None

analyze.dimension.save_aliases_to_dataframe(auth_id, project_id, name, alias=None)

Get aliases as a Dataframe for reloading :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param alias: :type alias: str, list or none

Returns

Dataframe with alias nodes and values

Return type

df (Dataframe)

analyze.dimension.save_hierarchy_to_dataframe(auth_id, project_id, name, hierarchy=None)

Get hierarchy as a Dataframe for reloading :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param hierarchy: :type hierarchy: str, list or none

Returns

Dataframe with hierarchy data

Return type

df (Dataframe)

analyze.dimension.save_properties_to_dataframe(auth_id, project_id, name, property=None)

Get properties as a Dataframe for reloading :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param property: :type property: str, list or none

Returns

Dataframe with property nodes and values

Return type

df (Dataframe)

analyze.dimension.save_values_to_dataframe(auth_id, project_id, name, value=None)

Get values as a Dataframe for reloading :param project_id: Unique project identifier :type project_id: str :param name: Unique name for hierarchy dimension :type name: str :param value: :type value: str, list or none

Returns

Dataframe with values nodes and values

Return type

df (Dataframe)

analyze.dimension.search_by_label(project_id, text, criteria='contains', sort=None, keys=None)

Returns list of dimensions that match the search criteria :param project_id: Unique project identifier :type project_id: str :param text: The search text to locate :type text: str :param criteria: The search criteria (contains, exact, startswith, or endswith) :type criteria: str :param sort: List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)] :type sort: list :param keys: List of keys to return. Defaults to all. :type keys: list

Returns

result list of dicts with the following properties
  • project_id (str): Unique project identifier

  • branch (str): Project branch

  • id (str): Unique dimension identifier

  • name (str): Dimension Name

  • memo (str): Description of dimension

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.dimension.search_by_name_under_path(project_id, path='/', text='', criteria='contains', sort=None, keys=None)

Provides list of dimensions under a given path

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Object rollup path using unix style forward slashes

  • text (str) – Dimension name fragment to search for

  • criteria (str) – The search criteria (contains, exact, startswith, or endswith)

  • sort (list) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list) – List of keys to return. Defaults to all.

Returns

result list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique dimension identifier

  • name (str): Dimension Name

  • memo (str): Description of dimension

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

Return type

list

analyze.dimension.set_consolidation(project_id, name, node, parent, consolidation='+', hierarchy=MAIN)

Sets the consolidation type of a node within the specified alt hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent node ID

  • child (str) – Unique hierarchy node identifier

  • consolidation – Consolidation type (‘~’, ‘+’, ‘-‘, ‘|’, ‘&’) ~ = None + = Add - = Subtract | = OR & = AND

  • hierarchy (str) – Hierarchy unique ID

Returns

None

analyze.dimension.set_default_aliases(auth_id, project_id, name, primary, secondary)

Adds a new alias

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • alias (str) – Alias unique ID

  • primary (str) – Primary alias unique ID

  • secondary (str) – Secondary alias unique ID

Returns

None

analyze.dimension.set_node_alias(project_id, name, node, alias, value)

Sets an alias for the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • alias (str) – Alias type

  • value (str) – Alias of node

Returns

None

analyze.dimension.set_node_property(project_id, name, node, property, value)

Sets a property for the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • property (str) – Property type

  • value (str) – Property value

Returns

None

set_node_value(project_id, name, node, value, value)

Sets value for the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • value (str) – Value name

  • number (float) – Value to set for value name

Returns

None

analyze.dimension.set_property_config(project_id, name, property, type, display, config)

Set the config for the property

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • property (str) – Property unique ID

  • type (str) – Property type ID

  • display (str) – property display option

  • role (str) – role in allocations (if dimensions is used this way)

  • config (str) – JSON config string

Returns

None

analyze.dimension.shift_down(project_id, dimension_ids, path)

Move the dimensions below following node within the same generation If bottom within parent, it moves to the next parent below at the same generation as it’s parent (if there is one) :param project_id: Unique project identifier :type project_id: str :param dimension_ids: List of Unique dimension identifier :type dimension_ids: list :param path: Current hierarchy path :type path: str

Returns

New path or None if cannot be moved

Return type

str

analyze.dimension.shift_left(project_id, dimension_ids, path)

Move the dimensions one generation up (if possible) :param project_id: Unique project identifier :type project_id: str :param dimension_ids: List of Unique dimension identifier :type dimension_ids: list :param path: Current hierarchy path :type path: str

Returns

New path or None if cannot be moved

Return type

str

analyze.dimension.shift_node_down(project_id, name, parent, children, hierarchy=MAIN)

Move the nodes below following node within the same generation If bottom within parent, it moves to the next parent below at the same generation as it’s parent (if there is one)

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent Node Key

  • children (list) – Child Node Key List

  • hierarchy (str) – Alt Hierarchy Key

Returns

New parent node or None if cannot be moved

Return type

str

analyze.dimension.shift_node_left(project_id, name, parent, children, hierarchy=MAIN)

Move the nodes one generation up (if possible)

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent Node Key

  • children (list) – Child Node Key List

  • hierarchy (str) – Alt Hierarchy Key

Returns

New parent node or None if cannot be moved

Return type

str

analyze.dimension.shift_node_right(project_id, name, parent, children, hierarchy=MAIN)

Move the nodes one generation down, looking upwards in the hierarchy for a suitable parent (if there is one)

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent Node Key

  • children (list) – Child Node Key List

  • hierarchy (str) – Alt Hierarchy Key

Returns

New parent node or None if cannot be moved

Return type

list

analyze.dimension.shift_node_up(project_id, name, parent, children, hierarchy=MAIN)

Move the nodes above prior node within the same generation If top within parent, it moves to the next parent above at the same generation as it’s parent (if there is one)

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • parent (str) – Parent Node Key

  • children (list) – Child Node Key List

  • hierarchy (str) – Alt Hierarchy Key

Returns

New parent node or None if cannot be moved

Return type

str

analyze.dimension.shift_right(project_id, dimension_ids, path)

Move the dimensions one generation down, looking upwards in the hierarchy for a suitable parent (if there is one) :param project_id: Unique project identifier :type project_id: str :param dimension_ids: List of Unique dimension identifier :type dimension_ids: list :param path: Current hierarchy path :type path: str

Returns

New path or None if cannot be moved

Return type

str

analyze.dimension.shift_up(project_id, dimension_ids, path)

Move the dimensions above prior node within the same generation If top within parent, it moves to the next parent above at the same generation as it’s parent (if there is one) :param project_id: Unique project identifier :type project_id: str :param dimension_ids: List of Unique dimension identifier :type dimension_ids: list :param path: Current hierarchy path :type path: str

Returns

New path or None if cannot be moved

Return type

str

analyze.dimension.sort_alt_hierarchy(project_id, name, hierarchy=MAIN, ordering=None, alpha=True)

Sort an alt hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique dimension identifier

  • hierarchy (str) – Name of hierarchy

  • ordering (str) – DESC/desc to sort in descending order

  • alpha (bool) – True = sort alphanumerically (default) False = sort numerically

Returns

None

analyze.dimension.sort_children(auth_id, project_id, name, node, hierarchy, ordering=None, alpha=True)

Sort a parent’s children

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Alternate hierarchy unique ID

  • ordering (str) – DESC/desc to sort in descending order

  • alpha (bool) – True = sort alphanumerically (default) False = sort numerically

Returns

None

analyze.dimension.sort_descendents(auth_id, project_id, name, node, hierarchy, ordering=None, alpha=True)

Sort a parent’s children

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

  • hierarchy (str) – Alternate hierarchy unique ID

  • ordering (str) – DESC/desc to sort in descending order

  • alpha (bool) – True = sort alphanumerically (default) False = sort numerically

Returns

None

analyze.dimension.update(project_id, dimension_id, **kwargs)

Updates a dimension

Parameters
  • project_id (str) – Unique project identifier

  • dimension_id (str) – Unique dimension identifier

Kwargs:

name (str): The object name memo (str): The object description view_manager (bool): Dimension is visible to Manager roles if True view_explorer (bool): Dimension is visible to Explorer roles if True

Returns

result dict with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique dimension identifier

  • name (str): Dimension Name

  • memo (str): Description of dimension

  • view_manager (bool): Dimension is visible to Manager roles if True

  • view_explorer (bool): Dimension is visible to Explorer roles if True

  • paths (list): List of hierarchy paths that reference the dimension

  • labels (list): List of labels assigned to dimension

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

dict

analyze.dimension.validate_uuid4(uuid_string)
analyze.dimension.view_explorer(project_id, dimension_ids, allowed=True)

Sets View Explorer flag

Parameters
  • project_id (str) – Unique project identifier

  • dimension_ids (str) – Unique dimension identifier or list of unique dimension identifiers

  • allowed (bool) – Indicate whether Explorer role can view item

Returns

None

analyze.dimension.view_manager(project_id, dimension_ids, allowed=True)

Sets View Manager flag

Parameters
  • project_id (str) – Unique project identifier

  • dimension_ids (str) – Unique dimension identifier or list of unique dimension identifiers

  • allowed (bool) – Indicate whether Manager role can view item

Returns

None

analyze.dimension.which_aliases(node)

Returns the aliases used by the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique alias node identifier

Returns

Aliases containing node and values

Return type

dict

analyze.dimension.which_attributes(project_id, name, node)

Returns the hierarchies and attribute node from the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

Returns

list of dicts with hHierarchies and attribute node for the node

Return type

list

analyze.dimension.which_hierarchies(project_id, name, node)

Returns the hierarchies from the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique hierarchy node identifier

Returns

Hierarchies containing node

Return type

list

analyze.dimension.which_properties(node)

Returns the properties used by the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique property node identifier

Returns

Properties containing node and values

Return type

dict

analyze.dimension.which_values(node)

Returns the values used by the specified node

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique name for hierarchy dimension

  • node (str) – Unique property node identifier

Returns

Values containing node and values

Return type

dict