Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

All Plugin Functions

All the functions available on this instance of nadi, are listed here.

Env Functions

PluginFunctionHelp
attributesexpExponential
attributesfloat_divFloat Division (same as / operator)
attributesfloat_multFloat Multiplication (same as * operator)
attributesgetget the choosen attribute from Array or AttrMap
attributeslogLogarithm of a value, natural if base not given
attributesparse_attrParse attribute from string
attributesparse_attrmapParse attribute from string
attributespowfFloat power
attributespowiInteger power
attributessqrtSquare Root
attributesstrmapmap values from the attribute based on the given table
coreappendappend a value to an array
corearraymake an array from the arguments
coreassert_eqAssert the two values are equal
coreassert_neqAssert the two values are not equal
coreassertAssert the condition is true
coreattrmapmake an attrmap from the arguments
coreconcatConcat the strings
corecount_strGet a count of unique string values
corecountCount the number of true values in the array
coredayday from date/datetime
corefloatmake a float from value
coreintmake an int from the value
coreisinfcheck if a float is +/- infinity
coreisnacheck if a float is nan
corejsonformat the attribute as a json string
corelengthlength of an array or hashmap
coremax_numMinimum of the variables
coremaxMaximum of the variables
coremin_numMinimum of the variables
coreminMinimum of the variables
coremonthmonth from date/datetime
coreprodProduct of the variables
corerangeGenerate integer array, end is not included
corestrmake a string from value
coresumSum of the variables
coretype_nameType name of the arguments
coreunique_strGet a list of unique string values
coreyearyear from date/datetime
debugclipEcho the ––8<–– line for clipping syntax
debugdebugPrint the args and kwargs on this function
debugechoEcho the string to stdout or stderr
debugsleepsleep for given number of milliseconds
dsslist_catalogList the catalog of the dss file
filesexistsChecks if the given path exists
filesfrom_fileReads the file contents as string
filesto_fileWrites the string to the file
logicallcheck if all of the bool are true
logicandBoolean and
logicanycheck if any of the bool are true
logiceqEquality than check
logicgtGreater than check
logicifelseSimple if else condition
logicltLess than check
logicnotboolean not
logicorboolean or
nadi_pdftypst_compileconvert the typst content into pdf/svg/png
regexstr_countCount the number of matches of given pattern in the string
regexstr_filterFilter from the string list with only the values matching pattern
regexstr_find_allFind all the matches of the given pattern in the value
regexstr_findFind the given pattern in the value
regexstr_matchCheck if the given pattern matches the value or not
regexstr_replaceReplace the occurances of the given match
regexstr_splitSplit the string with the given pattern
renderrenderRender the template based on the node attributes

Node Functions

PluginFunctionHelp
attributesfirst_attrReturn the first Attribute that exists
attributesget_attrRetrive attribute
attributeshas_attrCheck if the attribute is present
attributesload_attrsLoads attrs from file for all nodes based on the given template
attributesload_toml_renderSet node attributes by loading a toml from rendered template
attributesprint_all_attrsPrint all attrs in a node
attributesprint_attrsPrint the given node attributes if present
attributesset_attrs_ifelseif else condition with multiple attributes
attributesset_attrs_renderSet node attributes based on string templates
attributesset_attrsSet node attributes
commandcommandRun the given template as a shell command.
commandrunRun the node as if it’s a command if inputs are changed
corehas_outletNode has an outlet or not
coreinputs_attrGet attributes of the input nodes
coreinputs_countCount the number of input nodes in the node
coreoutput_attrGet attributes of the output node
damscount_node_ifCount the number of nodes upstream at each point that satisfies a certain condition
damsmin_yearPropagate the minimum year downstream
datafilldatafill_experiment
datafillload_csv_fill
errorscalc_ts_errorCalculate Error from two timeseries values in the node
errorscalc_ts_errorsCalculate Error from two timeseries values in the node
filesexistsChecks if the given path exists when rendering the template
print_nodeprint_nodePrint the node with its inputs and outputs
renderrenderRender the template based on the node attributes
seriesset_seriesset the following series to the node
seriessr_countNumber of series in the node
seriessr_dtypeType name of the series
seriessr_lenLength of the series
seriessr_listList all series in the node
seriessr_meanType name of the series
seriessr_sumSum of the series
seriessr_to_arrayMake an array from the series
streamflowcheck_negativeCheck the given streamflow timeseries for negative values
timeseriests_countNumber of timeseries in the node
timeseriests_dtypeType name of the timeseries
timeseriests_lenLength of the timeseries
timeseriests_listList all timeseries in the node
timeseriests_printPrint the given timeseries values in csv format

Network Functions

PluginFunctionHelp
attributesset_attrs_renderSet network attributes based on string templates
attributesset_attrsSet network attributes
commandcommandRun the given template as a shell command.
commandparallelRun the given template as a shell command for each nodes in the network in parallel.
connectionsload_edgesLoad the given edges into the network
connectionsload_fileLoad the given file into the network
connectionsload_strLoad the given file into the network
connectionssave_fileSave the network into the given file
connectionssubsetTake a subset of network by only including the selected nodes
corecountCount the number of nodes in the network
corenode_attrGet the attr of the provided node
coreoutletGet the name of the outlet node
datafillsave_experiments_csvWrite the given nodes to csv with given attributes and experiment results
errorscalc_attr_errorCalculate Error from two attribute values in the network
fancy_printfancy_printFancy print a network
gisgis_load_attrsLoad node attributes from a GIS file
gisgis_load_networkLoad network from a GIS file
gisgis_save_connectionsSave GIS file of the connections
gisgis_save_nodesSave GIS file of the nodes
gnuplotplot_timeseriesGenerate a gnuplot file that plots the timeseries data in the network
graphvizsave_graphvizSave the network as a graphviz file
htmlexport_mapExports the network as a HTML map
nadi_pdftypst_tableGenerate Typst code for given Table
print_nodeprint_attr_csvPrint the given attributes in csv format with first column with node name
renderrender_nodesRender each node of the network and combine to same variable
renderrender_templateRender a File template for the nodes in the whole network
renderrenderRender from network attributes
tablesave_csvSave CSV
tabletable_to_markdownRender the Table as a rendered markdown
timeseriesseries_csvWrite the given nodes to csv with given attributes and series
timeseriests_print_csvSave timeseries from all nodes into a single csv file
visualsset_nodesize_attrsSet the node size of the nodes based on the attribute value
visualssvg_saveExports the network as a svg