# 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*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *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*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      New description. None inherits the source’s latest description.
    - **title_suffix** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      Custom suffix for the server-generated title. Defaults to “copy”.
      Ignored when [`title`](https://dev.nominal.io/python/ref/generated/nominal.core.WorkbookTemplate.md#nominal.core.WorkbookTemplate.title "nominal.core.WorkbookTemplate.title") is provided.
    - **labels** (*Sequence**[*[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*]* *|* *None*)

      New labels. None inherits the source labels; an empty sequence clears them.
    - **properties** (*Mapping**[*[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*,* [*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*]* *|* *None*)

      New properties. None inherits the source properties; an empty mapping clears them.
    - **is_published** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))

      Whether to publish the copy. Defaults to True; pass False for an unpublished copy.
    - **workspace** ([*Workspace*](https://dev.nominal.io/python/ref/generated/nominal.core.Workspace.md#nominal.core.Workspace "nominal.core.Workspace") *|* [*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *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

```python
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*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      Title of the workbook to create. By default, uses the title of this template
    - **description** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      Description of the workbook to create. By default, uses the description of this template
    - **run** ([*Run*](https://dev.nominal.io/python/ref/generated/nominal.core.Run.md#nominal.core.Run "nominal.core.run.Run") *|* [*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      Run to visualize in the workbook.

      **Note:** May not be provided alongside `asset`.
    - **asset** ([*Asset*](https://dev.nominal.io/python/ref/generated/nominal.core.Asset.md#nominal.core.Asset "nominal.core.asset.Asset") *|* [*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      Asset to visualize in the workbook.

      **Note:** May not be provided alongside `run`.
    - **is_draft** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))

      Whether to create the workbook in draft state. Defaults to False.

Return type:
:   [*Workbook*](https://dev.nominal.io/python/ref/generated/nominal.core.Workbook.md#nominal.core.Workbook "nominal.core.workbook.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*](https://dev.nominal.io/python/ref/generated/nominal.core.Workbook.md#nominal.core.Workbook "nominal.core.workbook.Workbook")

### get_refnames()

Get the list of refnames used within the workbook.

Return type:
:   [*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.15)")[[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")]

### is_archived()

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

Return type:
:   [*bool*](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")

### is_published()

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

Return type:
:   [*bool*](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")

### publish()

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

### refresh()

Return type:
:   [*Self*](https://docs.python.org/3/library/typing.html#typing.Self "(in Python v3.15)")

### 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*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      Replacement description. An empty string clears it.
    - **title** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      Replacement title.
    - **labels** ([*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.15)")*[*[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*]* *|* *None*)

      Replacement labels. An empty sequence clears them.
    - **properties** ([*Mapping*](https://docs.python.org/3/library/typing.html#typing.Mapping "(in Python v3.15)")*[*[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*,* [*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*]* *|* *None*)

      Replacement properties. An empty mapping clears them.
    - **is_published** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") *|* *None*)

      True publishes the template; False unpublishes it.
    - **is_archived** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") *|* *None*)

      True archives the template; False restores it.

Returns:
:   This instance with refreshed metadata, without an additional fetch.

Return type:
:   [*Self*](https://docs.python.org/3/library/typing.html#typing.Self "(in Python v3.15)")

### update_refnames(refname_map)

Replace data source refnames used by this template.

Refreshes this instance from the returned template metadata.

Parameters:
:   **refname_map** ([*Mapping*](https://docs.python.org/3/library/typing.html#typing.Mapping "(in Python v3.15)")*[*[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*,* [*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*]*)

    Mapping from existing refnames to their replacements.
