Writing recipes¶
For more information about recipes, see Recipes based on code.
To start creating a recipe plugin, you have to write a “regular” Python recipe and then make it reusable:
- Go to the Advanced tab
- Click on “Convert to custom recipe”
- Select the dev plugin to add the custom recipe to
- Click on “Convert”
Recipe roles¶
Each role has the following structure:
name
: Name of the role, how it’s referencedarity
: UNARY or NARY (can accept one or multiple values?)required
(boolean, default false): Does this role need to be filled?acceptsDataset
(boolean, default true)acceptsManagedFolder
(boolean, default false)
Flow view¶
To make a new recipe directly available from the Flow view when selecting a dataset:
- Edit the
recipe.json
file - Add the line
"selectableFromDataset": "main",
, wheremain
must be replaced by the name of the input role in which the selected dataset will go
The resulting file will look like:
{
"meta" : {
"label" : "My custom recipe",
"icon" : "icon-puzzle-piece"
},
"kind" : "PYTHON",
"selectableFromDataset": "main",
"inputRoles" : [
{
"name": "main",
"label": "Input dataset",
"arity": "UNARY",
"required": true,
"acceptsDataset": true
}
],
"outputRoles" : [
{
"name": "output",
"label": "Output dataset",
"arity": "UNARY",
"required": true,
"acceptsDataset": true
}
],
"params": [],
"resourceKeys" : []
}