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

Node Functions

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

Network Functions

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