Create Snowflake Notebooks

This topic describes how to create Snowflake Notebooks. You can access Snowflake Notebooks through Snowsight. You can create a notebook with the following methods:

Tip

You can also create a notebook using SQL. See CREATE NOTEBOOK.

Prerequisites

Create a new notebook

To create a Snowflake Notebook, follow these steps:

  1. Sign in to Snowsight.

  2. Select Projects » Notebooks in the left-side navigation menu.

  3. Select + Notebook.

    Create new notebook button.
  4. Enter a name for your notebook.

    Create new notebook dialogue box.
  5. Select a Notebook location. This is the database and schema in which to store your notebook. These cannot be changed after you create the notebook.

    Note

    The Notebook location dropdown may not show databases created after the Create Notebook dialog is opened. If you can not find your recently created database, schema, or warehouse, try closing and reopening the Create Notebook dialog.

  6. (Optional) Change the selected warehouse to use to run your notebook.

    For guidance on what size warehouse to use, see Warehouse recommendations for running Snowflake Notebooks.

  7. (Optional) If you want to save the current selections for future notebooks, select the Remember these settings check box.

  8. Select Create to create and open your notebook.

For information about adding cells, see Develop and run code in Snowflake Notebooks.

Create Snowflake Notebooks from an existing file

You can create a notebook in Snowflake by importing a file with the *.ipynb extension. This could be a notebook file that has been created from an application outside of Snowflake.

  1. Sign in to Snowsight.

  2. Select Projects » Notebooks.

  3. Next to + Notebook, open the drop-down menu and select Import .ipynb file.

  4. Using the file browser, browse to and open the file that you want to import.

  5. Enter a name for your notebook.

  6. Select a Notebook location. This is the database and schema in which to store your notebook. These cannot be changed after you create the notebook.

  7. (Optional) Change the selected warehouse to use to run your notebook.

    For guidance on what size warehouse to use, see Warehouse recommendations for running Snowflake Notebooks.

  8. Select Create to create and open your notebook.

Note

If your notebook imports Python packages, you must add the packages to the notebook before you can run the imported notebook. See Import Python packages to use in notebooks. If the package you use in your imported notebook is not available, your code might not run.

For information about adding cells, see Develop and run code in Snowflake Notebooks.

Create a notebook from a Git repository

You can sync your notebook development with a Git repository. Then you can create Snowflake Notebooks from notebooks in that Git repository.

To create a notebook from a file in Git, see Create a notebook from a file in a Git repository.

Duplicate an existing notebook

You can duplicate existing Snowflake Notebooks. Duplicating notebooks may be useful if you want to, for example, test out some code changes without altering the original notebook version.

When you duplicate a notebook, the copied notebook is created with the same role and warehouse as the original notebook, and is contained in the same database and schema as the original notebook. Because of this, you cannot duplicate a notebook to move it to a different database and schema, or to change ownership.

To duplicate a notebook, complete the following steps:

  1. Sign in to Snowsight.

  2. Select Projects » Notebooks.

  3. Open the notebook that you want to duplicate.

  4. Select the vertical ellipsis more actions for worksheet menu, and then select Duplicate.

  5. (Optional) enter a name for the duplicate notebook, and then select Duplicate.

    The duplicate notebook is created.

  6. In the confirmation dialog, select Close to return to the original notebook, or Open notebook to open the duplicate notebook.

Open an existing notebook

To open an existing notebook, follow these steps:

  1. Sign in to Snowsight.

  2. Select Notebooks.

  3. Review the list of notebooks.

    You can see all notebooks owned by your active role or owned by a role inherited by your active role.

  4. Select a notebook to open it for editing.

    For details about editing notebooks, see Develop and run code in Snowflake Notebooks.

When you open a notebook, you can see cached results from the last time you ran any cells in the notebook. The notebook is in the Not connected state by default, but if you select that state or run any cell, your notebook connects to your virtual warehouse.

Next step