WorkbookTemplate#
- class nominal.core.WorkbookTemplate(rid, title, description, labels, properties, workbook_type)#
Bases:
HasRid,RefreshableConjureMixin[Template|TemplateSummary]A reusable workbook layout for creating workbooks with new data scopes.
- workbook_type: WorkbookType#
- archive()#
Archive this workbook template. Archived workbook templates are not deleted, but are hidden from the UI. Refreshes this instance from the returned metadata.
- clone(title=None, description=None, *, title_suffix=None, labels=None, properties=None, is_published=True, workspace=None)#
Create a copy of this template’s latest main-branch content and metadata.
Copies the layout and channel variables on the server and returns a new template reference. The copy is published by default.
- Parameters:
title (str | None)
New title. Defaults to the source’s latest title followed by “ - copy”. Copying an existing copy increments its suffix, e.g. “ - copy (2)”.
description (str | None)
New description. None inherits the source’s latest description.
title_suffix (str | None)
Custom suffix for the server-generated title. Defaults to “copy”. Ignored when
titleis provided.labels (Sequence[str] | None)
New labels. None inherits the source labels; an empty sequence clears them.
properties (Mapping[str, str] | None)
New properties. None inherits the source properties; an empty mapping clears them.
is_published (bool)
Whether to publish the copy. Defaults to True; pass False for an unpublished copy.
workspace (Workspace | str | None)
Workspace or workspace RID for the copy. Defaults to the client’s default workspace.
- Returns:
Reference to the newly created template.
- Return type:
Self
Example
copy = template.clone( title_suffix="Run analysis", labels=[], properties={} )
- create_workbook(*, title: str | None = None, description: str | None = None, run: Run | str, is_draft: bool = False) Workbook#
- create_workbook(*, title: str | None = None, description: str | None = None, asset: Asset | str, is_draft: bool = False) Workbook
Create workbook from this workbook template
- Parameters:
title (str | None)
Title of the workbook to create. By default, uses the title of this template
description (str | None)
Description of the workbook to create. By default, uses the description of this template
-
Run to visualize in the workbook.
Note: May not be provided alongside
asset. -
Asset to visualize in the workbook.
Note: May not be provided alongside
run. is_draft (bool)
Whether to create the workbook in draft state. Defaults to False.
- Return type:
Note
Only supports singular
runinstead of a list ofrunsbecause workbook templates only support standard workbooks and not comparison workbooks.Note
Only supports singular
assetinstead of a list ofassetsbecause workbook templates only support single asset workbooks.- Returns:
The instantiated workbook
- Return type:
- is_archived()#
Return whether the template is archived and refresh its metadata from the same response.
- Return type:
- is_published()#
Return whether the template is published and refresh its metadata from the same response.
- Return type:
- publish()#
Publish this template and refresh its metadata from the update response.
- unarchive()#
Unarchive this workbook template, making it visible in the UI again. Refreshes this instance from the returned metadata.
- unpublish()#
Unpublish this template and refresh its metadata from the update response.
- update(*, description=None, title=None, labels=None, properties=None, is_published=None, is_archived=None)#
Replace template metadata and refresh this instance from the response.
None leaves a field unchanged. Labels and properties replace existing collections; merge with their current values before calling this method to append entries.
- Parameters:
description (str | None)
Replacement description. An empty string clears it.
title (str | None)
Replacement title.
-
Replacement labels. An empty sequence clears them.
properties (Mapping[str, str] | None)
Replacement properties. An empty mapping clears them.
is_published (bool | None)
True publishes the template; False unpublishes it.
is_archived (bool | None)
True archives the template; False restores it.
- Returns:
This instance with refreshed metadata, without an additional fetch.
- Return type: