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
DEBUGechoEcho the string to stdout or stderr
ATTRSkeys
COREfloatmake a float from value
MATHexpExponential
MATHlogLogarithm of a value, natural if base not given
CONNroot_nodedefault name used for ROOT node of the network
COREcount_strGet a count of unique string values
COREassert_neqAssert the two values are not equal
FILESlineChecks if the given path exists
COREattrmapmake an attrmap from the arguments
COREassert_eqAssert the two values are equal
gisfieldsShow the fields in the GIS file layer as a list
gisvaluesReturns the values from a feature in a GIS file from its index
COREappendappend a value to an array
COREdayday from date/datetime
COREcountCount the number of true values in the array
CORErangeGenerate integer array, end is not included
REGEXstr_filterFilter from the string list with only the values matching pattern
csvschemaList the columns in a CSV file
csvcount_usgs_yearsCount the number of data in a column from a CSV file
ATTRSfloat_divFloat Division (same as / operator)
ATTRSparse_attrmapParse attribute map from string
COREunique_strGet a list of unique string values
COREmin_numMinimum of the variables
LOGICnotboolean not
COREstrmake a string from value
COREisnacheck if a float is nan
LOGICallcheck if all of the bool are true
REGEXstr_find_allFind all the matches of the given pattern in the value
REGEXstr_findFind the given pattern in the value
COREjsonformat the attribute as a json string
FILESto_fileWrites the string to the file
COREdrop_nanappend a value to an array
ATTRSparse_attrParse attribute from string
COREconcatConcat the strings
COREassertAssert the condition is true
COREyearyear from date/datetime
REGEXstr_countCount the number of matches of given pattern in the string
VISUALSsvg_settingsGenerate the margins for the SVGs
COREmaxMaximum of the variables
COREtype_nameType name of the arguments
LOGICifelseSimple if else condition
DEBUGsleepsleep for given number of milliseconds
REGEXstr_matchCheck if the given pattern matches the value or not
COREmax_numMinimum of the variables
LOGICanycheck if any of the bool are true
gislineShow the layers of the GIS file as a list
COREarraymake an array from the arguments
COREminMinimum of the variables
FILESexistsChecks if the given path exists
COREsumSum of the variables
LOGICgtGreater than check
MATHpowiInteger power
csvcount_dataCount the number of data in a column from a CSV file
CORElengthlength of an array or hashmap
LOGICltLess than check
LOGICorboolean or
COMMANDshell_envGet environment variable from the shell
MATHsqrtSquare Root
ATTRSgetget the choosen attribute from Array or AttrMap
COREintmake an int from the value
COREflattenflatten the given list of arrays into a single one
COREmonthmonth from date/datetime
COMMANDcommandRuns a command in terminal and returns attribute map
COREinsertInsert a key and value to a attrmap
DEBUGclipEcho the ----8<---- line for clipping syntax
COREisinfcheck if a float is +/- infinity
gisfeatures_countShow the fields in the GIS file layer as a list
LOGICandBoolean and
LOGICeqEquality than check
RENDERrenderRender the template based on the node attributes
MATHpowfFloat power
ATTRSfloat_multFloat Multiplication (same as * operator)
REGEXstr_replaceReplace the occurances of the given match
jsonload_jsonLoads JSON file as a AttrMap
ATTRSstrmapmap values from the attribute based on the given table
gislayersShow the layers of the GIS file as a list
DEBUGdebugPrint the args and kwargs on this function
COREstr_quoteConvert string to double quoted form
COREprodProduct of the variables
COMMANDset_shell_envSet environment variable in the shell
REGEXstr_splitSplit the string with the given pattern
FILESfrom_fileReads the file contents as string

Node Functions

PluginFunctionHelp
SERIESset_seriesset the following series to the node
RENDERrenderRender the template based on the node attributes
FILESexistsChecks if the given path exists when rendering the template
ATTRSfirst_attrReturn the first Attribute that exists
TSts_dtypeType name of the timeseries
csvnode_nameExample Node function for the plugin
COREinputs_attrGet attributes of the input nodes
jsonload_jsonLoads JSON file as a AttrMap
ATTRSset_attrsSet node attributes
ATTRSload_attrsLoads attrs from file for all nodes based on the given template
COREinputs_countCount the number of input nodes in the node
SERIESsr_dtypeType name of the series
SERIESsr_sumSum of the series values
TSts_countNumber of timeseries in the node
TSts_completeConvert the timeseries to complete if it doesn’t have gaps
SERIESsr_listList all series in the node
SERIESsr_fillFill the series with a value
ATTRShas_attrCheck if the attribute is present
ATTRSdel_attrsDelete attributes from the given node
COMMANDrunRun the node as if it’s a command if inputs are changed
ATTRSset_attrs_renderSet node attributes based on string templates
COREhas_outletNode has an outlet or not
COREoutput_attrGet attributes of the output node
TSts_lenLength of the timeseries
TSts_printPrint the given timeseries values in csv format
SERIESsr_deleteDelete the series with the given name
ATTRSset_attrs_ifelseif else condition with multiple attributes
SERIESsr_countNumber of series in the node
SERIESsr_to_arrayMake an array from the series if it’s complete
ATTRSprint_attrsPrint the given node attributes if present
ATTRSload_toml_renderSet node attributes by loading a toml from rendered template
TSts_listList all timeseries in the node
COMMANDcommandRun the given template as a shell command.
SERIESsr_sortSort an series
ATTRSprint_all_attrsPrint all attrs in a node
SERIESsr_lenLength of the series
SERIESsr_meanMean of a series values
csvcolumnread a single column from a CSV file
SERIESsr_getget nth member of a series
ATTRSget_attrRetrive attribute
TSts_deleteDelete the timeseries with the given name

Network Functions

PluginFunctionHelp
COREnode_mapGet a attrmap with node name and attributes
gisload_attrsLoad node attributes from a GIS file
gissave_connectionsSave GIS file of the connections
COREnode_attrGet the attr of the provided node
VISUALSsvg_ts_blocks
TSseries_csvWrite the given nodes to csv with given attributes and series
CONNsubset_fromTake a subset of network by taking the given node as new outlet
ATTRSset_attrsSet network attributes
RENDERrender_nodesRender each node of the network and combine to same variable
CONNload_strLoad network from the given string
CONNsubsetTake a subset of network by only including the selected nodes
COMMANDcommandRun the given template as a shell command.
COREcountCount the number of nodes in the network
TABLEsave_csvSave CSV
gisload_networkLoad network from a GIS file
TABLEtable_to_markdownRender the Table as a rendered markdown
ATTRSset_attrs_renderSet network attributes based on string templates
COREoutletGet the name of the outlet node
CONNload_edgesLoad the given edges as a network
COMMANDparallelRun the given template as a shell command for each nodes in the network in parallel.
RENDERrender_templateRender a File template for the nodes in the whole network
csvload_seriesLoad series values to nodes
CONNsubset_largestTake a subset of network by only including the largest blob of connected nodes
ATTRSset_node_attrsSet node attributes in a network using a attrmap
VISUALSset_nodesize_attrsSet the node size of the nodes based on the attribute value
CONNsave_fileSave the network into the given file
VISUALSsvg_saveExports the network as a svg
graphvizsaveSave the network as a graphviz file
gissave_nodesSave GIS file of the nodes
RENDERrenderRender from network attributes
TSts_print_csvSave timeseries from all nodes into a single csv file
CONNload_fileLoad the given file into the network
csvload_timeseriesLoad timeseries values to nodes