Plugins#

The API offers methods to:

  • Install plugins

  • Uninstall plugins and list their usages

  • Update plugins

  • Read and write plugin settings

  • Create and update plugin code envs

  • List macros that can be run

  • Run macros

Installing plugins#

From a Zip file#

with open("myplugin.zip", "rb") as f:
    client.install_plugin_from_archive(f)

From the Dataiku plugin store#

future = client.install_plugin_from_store("googlesheets")
future.wait_for_result()

From a Git repository#

future = client.install_plugin_from_git("[email protected]:myorg/myrepo")
future.wait_for_result()

Uninstalling plugins#

Listing usages of a plugin#

plugin = client.get_plugin('my-plugin-id')
usages = plugin.list_usages()

Uninstalling a plugin#

plugin = client.get_plugin('my-plugin-id')
future = plugin.delete()

Plugin deletion fails if a usage is detected. It can be forced with force=True:

plugin = client.get_plugin('my-plugin-id')
future = plugin.delete(force=True)

Managing code envs#

plugin = client.get_plugin("myplugin")

# Start creating the code env, and wait for it to be done
future = plugin.create_code_env()
result = future.wait_for_result()

# NB: If the plugin requires Python 3.9 for example, you will use something like:
# future = plugin.create_code_env(python_interpreter="PYTHON39")
# result = future.wait_for_result()

# Now the code env is created, but we still need to configure the plugin to use it
settings = plugin.get_settings()
settings.set_code_env(result["envName"])
settings.save()

Handling settings#

plugin = client.get_plugin("myplugin")

# Obtain the current settings
settings = plugin.get_settings()
raw_settings = settings.get_raw()

# Modify the settings
# ...

# And save them back
settings.save()

Reference documentation#

Classes#

dataikuapi.dss.future.DSSFuture(client, job_id)

A future represents a long-running task on a DSS instance.

dataikuapi.dss.macro.DSSMacro(client, ...[, ...])

A macro on the DSS instance.

dataikuapi.dss.plugin.DSSMissingType(data)

Information on a type not found while analyzing usages of a plugin.

dataikuapi.dss.plugin.DSSPlugin(client, ...)

A plugin on the DSS instance.

dataikuapi.dss.plugin.DSSPluginSettings(...)

The settings of a plugin.

dataikuapi.dss.plugin.DSSPluginParameterSet(...)

A parameter set in a plugin.

dataikuapi.dss.plugin.DSSPluginUsage(data)

Information on a usage of an element of a plugin.

dataikuapi.dss.plugin.DSSMissingType(data)

Information on a type not found while analyzing usages of a plugin.

dataikuapi.dss.plugin.DSSPluginUsages(data)

Information on the usages of a plugin.

Functions#

create_code_env([python_interpreter, conda])

Start the creation of the code env of the plugin.

delete([force])

Delete a plugin.

get_plugin(plugin_id)

Get a handle to interact with a specific plugin

get_settings()

Get the plugin-level settings.

install_plugin_from_archive(fp)

Install a plugin from a plugin archive (as a file object)

install_plugin_from_git(repository_url[, ...])

Install a plugin from a Git repository.

install_plugin_from_store(plugin_id)

Install a plugin from the Dataiku plugin store

list_usages([project_key])

Get the list of usages of the plugin.

save()

Save the settings to DSS.

set_code_env(code_env_name)

Set the name of the code env to use for this plugin.

wait_for_result()

Waits for the completion of the long-running task, and returns its result.