View

analyze.view.add_label(project_id, view_id, label)

Sets a label on a view

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique view identifier

  • label (str) – The label unique name

Returns

None

analyze.view.add_path(project_id, view_id, path)

Adds a view reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique view identifier

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

Returns

None

analyze.view.add_paths(project_id, additions)

Adds multiple view reference paths in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

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

Returns

None

analyze.view.copy(project_id, old_name, new_name)

Copies a view

Parameters
  • project_id (str) – Unique project identifier

  • old_name (str) – the view to copy

  • new_name (str) – the name the copied view should have

Returns

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

  • id (str): Unique view identifier

  • name (str): Unique model identifier

  • memo (str): Description of tables

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

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

  • column_count (int): Column count

  • cluster_id (str): Internal identifier for data cluster assignment

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

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

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

  • updated_by (int): User ID of last updater

  • published_name (str): Name of view published for reporting access

Return type

dict

analyze.view.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.view.create(project_id, name, query, params=None, table_id)

Creates a view. Provide only one of table_id or query. If both are provided, query will take precedence.

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – The view name. Must be unique, and follow postgres table name conventions.

  • query (str) – The postgresql query you plan to turn into a view.

  • params (dict, optional) – bindparams for the query

  • table_id (str) – The table_id you plan to turn into a view

analyze.view.create_directory(project_id, path)

Creates a folder in the table hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

Returns

None

analyze.view.delete(project_id, name)

Deletes a view

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique view name

Returns

None

analyze.view.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.view.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): Table unique identifier

Return type

list

analyze.view.labels(project_id, view_id)

Provides a list of labels for the view

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique view identifier

Returns

list of labels associated with View

Return type

list

analyze.view.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

View unique identifier

Return type

str

analyze.view.lookup_by_name(project_id, name)

Returns ID for path provided

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique view name

Returns

View unique identifier

Return type

str

analyze.view.move(project_id, old_name, new_name)

Renames a view

Parameters
  • project_id (str) – Unique project identifier

  • old_name (str) – the view to rename

  • new_name (str) – the name it should end up with

Returns

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

  • id (str): Unique view identifier

  • name (str): Unique model identifier

  • memo (str): Description of tables

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

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

  • column_count (int): Column count

  • cluster_id (str): Internal identifier for data cluster assignment

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

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

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

  • updated_by (int): User ID of last updater

  • published_name (str): Name of view published for reporting access

Return type

dict

analyze.view.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.view.move_path(project_id, view_id, from_path, to_path)

Moves a table reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique view identifier

  • from_path (str) – Original path

  • to_path (str) – Destination path

Returns

None

analyze.view.move_paths(project_id, moves)

Moves a view reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

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

Returns

None

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

Provides a list of paths for all tables and folders

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Initial path to search

Returns

List of table and directory paths

Return type

list

analyze.view.paths_from_id(project_id, view_id)

Provides a list of paths associated with the canonical id

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique table identifier

Returns

List of paths that point to the view specified

Return type

list

analyze.view.remove_label(project_id, view_id, label)

Removes a label on a view

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique view identifier

  • label (str) – The label unique name

Returns

None

analyze.view.remove_path(project_id, view_id, path)

Removes a view reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique view identifier

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

Returns

None

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

Returns list of views that match the search criteria

Parameters
  • project_id (str) – Unique project identifier

  • text (str) – The search text to locate

  • 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 view identifier

  • name (str): Unique model identifier

  • memo (str): Description of tables

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

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

  • column_count (int): Column count

  • cluster_id (str): Internal identifier for data cluster assignment

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

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

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

  • updated_by (int): User ID of last updater

  • published_name (str): Name of view published for reporting access

Return type

list

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

Returns list of views that match the search criteria

Parameters
  • project_id (str) – Unique project identifier

  • text (str) – The search text to locate

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

  • path (str) – Path to search below for matches

  • 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 view identifier

  • name (str): Unique model identifier

  • memo (str): Description of tables

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

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

  • column_count (int): Column count

  • cluster_id (str): Internal identifier for data cluster assignment

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

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

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

  • updated_by (int): User ID of last updater

  • published_name (str): Name of view published for reporting access

Return type

list

analyze.view.shift_down(project_id, view_ids, path)

Move the node 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

  • view_ids (list) – List of Unique view identifier

  • path (str) – Current hierarchy path

Returns

New path or None if cannot be moved

Return type

str

analyze.view.shift_left(project_id, view_ids, path)

Move the node one generation up (if possible)

Parameters
  • project_id (str) – Unique project identifier

  • view_ids (list) – List of Unique view identifier

  • path (str) – Current hierarchy path

Returns

New path or None if cannot be moved

Return type

str

analyze.view.shift_right(project_id, view_ids, path)

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

Parameters
  • project_id (str) – Unique project identifier

  • view_ids (list) – List of Unique view identifier

  • path (str) – Current hierarchy path

Returns

New path or None if cannot be moved

Return type

str

analyze.view.shift_up(project_id, view_ids, path)

Move the node 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

  • view_ids (list) – List of Unique view identifier

  • path (str) – Current hierarchy path

Returns

New path or None if cannot be moved

Return type

str

analyze.view.view(project_id, name, keys=None)

Provides detailed view information

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique view 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 view identifier

  • name (str): Unique model identifier

  • memo (str): Description of tables

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

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

  • column_count (int): Column count

  • cluster_id (str): Internal identifier for data cluster assignment

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

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

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

  • updated_by (int): User ID of last updater

  • published_name (str): Name of view published for reporting access

Return type

dict

analyze.view.view_explorer(project_id, view_ids, allowed=True)

Sets View Explorer flag

Parameters
  • project_id (str) – Unique project identifier

  • view_ids (str) – Unique view identifier or list of unique view identifiers

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

Returns

None

analyze.view.view_manager(project_id, view_ids, allowed=True)

Sets View Manager flag

Parameters
  • project_id (str) – Unique project identifier

  • view_ids (str) – Unique view identifier or list of unique view identifiers

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

Returns

None

analyze.view.views(project_id, id_filter=None, sort=None, keys=None)

Provides list of views in the project

Parameters
  • project_id (str) – Unique project identifier

  • id_filter (list) – List or tuple of view names to which to limit the results

  • 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 view identifier

  • name (str): Unique model identifier

  • memo (str): Description of tables

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

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

  • column_count (int): Column count

  • cluster_id (str): Internal identifier for data cluster assignment

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

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

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

  • updated_by (int): User ID of last updater

  • published_name (str): Name of view published for reporting access

Return type

list

analyze.view.views_from_path(project_id, path, sort=None, keys=None)

Provides list of tables 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 view identifier

  • name (str): Unique model identifier

  • memo (str): Description of tables

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

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

  • column_count (int): Column count

  • cluster_id (str): Internal identifier for data cluster assignment

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

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

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

  • updated_by (int): User ID of last updater

  • published_name (str): Name of view published for reporting access

Return type

list