View

analyze.view.add_label(project_id, view_id, label, branch='master')

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

  • branch (str) – Project branch

Returns

None

analyze.view.add_path(project_id, view_id, path, branch='master')

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 branch (str): Project branch

Returns

None

analyze.view.add_paths(project_id, additions, branch='master')

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

  • branch (str) – Project branch

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, branch='master')

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

  • branch (str) – Project branch

Returns

None

analyze.view.create(project_id, name, query, params=None, table_id, branch='master')

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

  • branch (str) – Project branch

analyze.view.create_directory(project_id, path, branch='master')

Creates a folder in the table hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

  • branch (str) – Project branch

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, branch='master')

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

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

  • branch (str) – Project branch

Returns

None

analyze.view.ids_from_path(project_id, path, branch='master')

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

  • branch (str) – Project branch

Returns

id (str): Table unique identifier

Return type

list

analyze.view.labels(project_id, view_id, branch='master')

Provides a list of labels for the view

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique view identifier

  • branch (str) – Project branch

Returns

list of labels associated with View

Return type

list

analyze.view.lookup_by_full_path(project_id, path, branch='master')

Returns ID for path provided

Parameters
  • project_id (str) – Unique project identifier

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

  • branch (str) – Project branch

Returns

View unique identifier

Return type

str

analyze.view.lookup_by_name(project_id, name, branch='master')

Returns ID for path provided

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique view name

  • branch (str) – Project branch

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, branch='master')

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

  • branch (str) – Project branch

Returns

None

analyze.view.move_path(project_id, view_id, from_path, to_path, branch='master')

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

  • branch (str) – Project branch

Returns

None

analyze.view.move_paths(project_id, moves, branch='master')

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

  • branch (str) – Project branch

Returns

None

analyze.view.paths(project_id, branch='master', path=None)

Provides a list of paths for all tables and folders

Parameters
  • project_id (str) – Unique project identifier

  • branch (str) – Project branch

  • 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, branch='master')

Provides a list of paths associated with the canonical id

Parameters
  • project_id (str) – Unique project identifier

  • view_id (str) – Unique table identifier

  • branch (str) – Project branch

Returns

List of paths that point to the view specified

Return type

list

analyze.view.remove_label(project_id, view_id, label, branch='master')

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

  • branch (str) – Project branch

Returns

None

analyze.view.remove_path(project_id, view_id, path, branch='master')

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 branch (str): Project branch

Returns

None

analyze.view.search_by_label(project_id, text, criteria='contains', branch='master', 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)

  • branch (str) – Project branch

  • 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='/', branch='master', 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

  • branch (str) – Project branch

  • 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.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, branch='master')

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

  • branch (str) – Project branch

Returns

None

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

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

  • branch (str) – Project branch

Returns

None

analyze.view.views(project_id, branch='master', 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, branch='master', 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

  • branch (str) – Project branch

  • 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