WorkbookTemplate#

class nominal.core.WorkbookTemplate(rid: str, title: str, description: str, labels: Sequence[str], properties: Mapping[str, str], workbook_type: WorkbookType)#

Bases: HasRid, RefreshableConjureMixin[Template | TemplateSummary]

A reusable workbook layout for creating workbooks with new data scopes.

rid: str#
title: str#
description: str#
labels: Sequence[str]#
properties: Mapping[str, str]#
workbook_type: WorkbookType#
property nominal_url: str#

Returns a link to the page for this Workbook Template in the Nominal app

archive() → None#

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: str | None = None, description: str | None = None, *, title_suffix: str | None = None, labels: Sequence[str] | None = None, properties: Mapping[str, str] | None = None, is_published: bool = True, workspace: Workspace | str | None = None) → Self#

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 – New title. Defaults to the source’s latest title followed by “ - copy”. Copying an existing copy increments its suffix, e.g. “ - copy (2)”.

  • description – New description. None inherits the source’s latest description.

  • title_suffix – Custom suffix for the server-generated title. Defaults to “copy”. Ignored when title is provided.

  • labels – New labels. None inherits the source labels; an empty sequence clears them.

  • properties – New properties. None inherits the source properties; an empty mapping clears them.

  • is_published – Whether to publish the copy. Defaults to True; pass False for an unpublished copy.

  • workspace – Workspace or workspace RID for the copy. Defaults to the client’s default workspace.

Returns:

Reference to the newly created template.

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 – Title of the workbook to create. By default, uses the title of this template

  • description – Description of the workbook to create. By default, uses the description of this template

  • run – Run to visualize in the workbook.

    Note: May not be provided alongside asset.

  • asset – Asset to visualize in the workbook.

    Note: May not be provided alongside run.

  • is_draft – Whether to create the workbook in draft state. Defaults to False.

Note

Only supports singular run instead of a list of runs because workbook templates only support standard workbooks and not comparison workbooks.

Note

Only supports singular asset instead of a list of assets because workbook templates only support single asset workbooks.

Returns:

The instantiated workbook

get_refnames() → Sequence[str]#

Get the list of refnames used within the workbook.

is_archived() → bool#

Return whether the template is archived and refresh its metadata from the same response.

is_published() → bool#

Return whether the template is published and refresh its metadata from the same response.

publish() → None#

Publish this template and refresh its metadata from the update response.

refresh() → Self#
unarchive() → None#

Unarchive this workbook template, making it visible in the UI again. Refreshes this instance from the returned metadata.

unpublish() → None#

Unpublish this template and refresh its metadata from the update response.

update(*, description: str | None = None, title: str | None = None, labels: Sequence[str] | None = None, properties: Mapping[str, str] | None = None, is_published: bool | None = None, is_archived: bool | None = None) → Self#

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 – Replacement description. An empty string clears it.

  • title – Replacement title.

  • labels – Replacement labels. An empty sequence clears them.

  • properties – Replacement properties. An empty mapping clears them.

  • is_published – True publishes the template; False unpublishes it.

  • is_archived – True archives the template; False restores it.

Returns:

This instance with refreshed metadata, without an additional fetch.

update_refnames(refname_map: Mapping[str, str]) → None#

Replace data source refnames used by this template.

Refreshes this instance from the returned template metadata.

Parameters:

refname_map – Mapping from existing refnames to their replacements.