How to Edit Dataiku Recipes and Plugins in Sublime

Goal

Though Jupyter notebooks are integrated into the Dataiku interface, some developers favor Sublime Text as an IDE. From within Sublime, you can:

  • Install the dataiku package
  • Configure Sublime to connect to an existing Dataiku instance
  • Pull code from an existing code recipe or plugin into Sublime
  • Edit the code in Sublime, and then
  • Save the code back to the code recipe or plugin

Note

This method can edit existing recipes and plugin files on the Dataiku instance, but cannot create new recipes or files.

Prerequisites

  • Familiarity with code recipes or plugins in Dataiku.

Technical Requirements

Install the Dataiku Package

  • In Sublime Text, open Tools > Command Palette.
  • Search for install and select Package Control: Install Package.
  • Search for dataiku and select Dataiku.

The Dataiku package provides commands for connecting to a Dataiku instance and editing recipes on the instance.

Connect to a Dataiku Instance

  • Open the Sublime Text Command Palette
  • Search for dataiku and select Dataiku: Configure DSS instances
  • This opens Dataiku.sublime-settings. Insert JSON of the format shown below, using the information for your instance and personal API key secret.
  • Save the settings.
{
              "instances": [
                      {
                              "name": "My DSS Instance",
                              "base_url": "http://localhost:12000",
                              "api_key": "SaHZlgrDHi1AfAc14flWt8vIgUyyUy6V",
                              "list_of_project_keys_to_exclude": [],
                              "list_of_plugin_ids_to_exclude": [],
                              "keep_only_code_recipes": true
                      }
              ]
      }

The parameters available for each Dataiku instance:

  • name. A descriptive name for the Dataiku instance that will be displayed in Sublime Text
  • base_url. The base URL of the Dataiku instance, without / at the end
  • api_key. The secret for your personal API key
  • list_of_project_keys_to_exclude. An optional a list of project keys that are excluded when Sublime Text searches for code recipes
  • keep_only_code_recipes. Determines whether visual recipes are hidden in Sublime Text. It is highly recommended to keep this option set to true.

Edit a Dataiku Recipe

  • Open the Sublime Text Command Palette
  • Search for dataiku and select Dataiku: Edit DSS recipes
  • Choose the recipe you want to edit from list

Changes made in Sublime are made to the recipe in Dataiku when you Save, overwriting any edits made in the meantime on the Dataiku instance.

../../_images/sublime-edit-recipe.png

Edit a Dataiku Plugin

  • Open the Sublime Text Command Palette
  • Search for dataiku and select Dataiku: Edit DSS plugins
  • Choose the plugin whose code you want to edit
  • Choose the file in the plugin that you want to edit

Changes made in Sublime are made to the recipe in Dataiku when you Save, overwriting any edits made in the meantime on the Dataiku instance.

../../_images/sublime-edit-plugin.png

What’s Next

The DataikuSublimeText extension is open sourced; feel free to contribute.