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.

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()#

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 title is 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 (Run | str | None)

    Run to visualize in the workbook.

    Note: May not be provided alongside asset.

  • asset (Asset | str | None)

    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:

Workbook

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

Return type:

Workbook

get_refnames()#

Get the list of refnames used within the workbook.

Return type:

Sequence[str]

is_archived()#

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

Return type:

bool

is_published()#

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

Return type:

bool

publish()#

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

refresh()#
Return type:

Self

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.

  • labels (Sequence[str] | None)

    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:

Self

update_refnames(refname_map)#

Replace data source refnames used by this template.

Refreshes this instance from the returned template metadata.

Parameters:

refname_map (Mapping[str, str])

Mapping from existing refnames to their replacements.