Workbooks in Nominal with Python

Workbooks are Nominal’s tool for creating and sharing interactive data visualizations and analyses. They can be created directly on the Nominal platform or programmatically using the Nominal Python SDK.

Creating a Workbook from a Template

Prerequisites

Make sure you have the nominal Python packages installed. You can install it using:

1pip3 install nominal

Connect to Nominal

Get your Nominal API token from your User settings page.

See the Quickstart for more details on connecting to Nominal from Python.

1import nominal.nominal as nm
2
3nm.set_token(
4 base_url = 'https://api.gov.nominal.io/api',
5 token = '* * *' # Replace with your Access Token from
6 # https://app.gov.nominal.io/settings/user?tab=tokens
7)
If you’re not sure whether your company has a Nominal tenant, please reach out to us.

Steps to Create a Workbook from a Template

  1. Obtain the Template RID:
    • Navigate to the Nominal platform.
    • Go to Workbooks ➔ Templates.
    • Click on the desired template.
    • In the top-left corner next to the template name, click the dropdown arrow ⌄.
    • Select Copy RID to copy the template RID to your clipboard.
  2. Obtain the Run RID:
    • Navigate to Runs.
    • Click on the run you want to associate with the workbook.
    • On the right side of the screen, locate the RID under “Metadata”.
  3. Create the Workbook Using the SDK:
1import nominal.nominal as nm
2
3nm.create_workbook_from_template(
4 template_rid = 'your_template_rid',
5 run_rid = 'your_run_rid',
6 title = 'My new workbook',
7 description = 'This is a new workbook created from a template',
8)

Accessing Your New Workbook

After creating the workbook programmatically:

  • Navigate back to Workbooks on the Nominal platform.
  • Locate your new workbook titled “My New Workbook”.
  • Open it to view and interact with your data visualizations.