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
ATTRSfloat_divFloat Division (same as / operator)
ATTRSfloat_multFloat Multiplication (same as * operator)
ATTRSgetget the choosen attribute from Array or AttrMap
ATTRSkeyskeys of the attribute map
ATTRSparse_attrParse attribute from string
ATTRSparse_attrmapParse attribute map from string
ATTRSstrmapmap values from the attribute based on the given table
ATTRSvaluesvalues of the attribute map
COMMANDcommandRuns a command in terminal and returns attribute map
COMMANDset_shell_envSet environment variable in the shell
COMMANDshell_envGet environment variable from the shell
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
COREdrop_nanappend a value to an array
COREflattenflatten the given list of arrays into a single one
COREfloatmake a float from value
COREhourhour from time/datetime
COREinsertInsert a key and value to a attrmap
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
COREminuteminute from time/datetime
COREmonthmonth from date/datetime
COREnanosecondnanosecond from time/datetime
COREnowget the current date time
COREprodProduct of the variables
CORErangeGenerate integer array, end is not included
COREsecondsecond from time/datetime
COREstr_quoteConvert string to double quoted form
COREstrmake a string from value
COREsumSum of the variables
COREtimediffget the current date time
COREto_attrmapmake an attrmap from a list of (k, v)
COREtodayget the current date
COREtype_nameType name of the arguments
COREunique_strGet a list of unique string values
COREyearyear from date/datetime
COREzipmake an array combining the arrays from arguments
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
FILESexistsChecks if the given path exists
FILESfrom_fileReads the file contents as string
FILESlineChecks if the given path exists
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
MATHexpExponential
MATHlogLogarithm of a value, natural if base not given
MATHpowfFloat power
MATHpowiInteger power
MATHsqrtSquare Root
OPTIMUMuniform_crossing_overCrossing over of linear genes from two parent given uniform probability
RANDOMrandom_boolRandom bool given uniform probability
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_joinJoin the list of strings with the given string
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
VISUALSimage
VISUALSsvg_open_multi
VISUALSsvg_open
VISUALSsvg_settingsGenerate the margins for the SVGs
csvcount_dataCount the number of data in a column from a CSV file
csvcount_usgs_yearsCount the number of data in a column from a CSV file
csvschemaList the columns in a CSV file
gisfeatures_countShow the fields in the GIS file layer as a list
gisfieldsShow the fields in the GIS file layer as a list
gislayersShow the layers of the GIS file as a list
gislineShow the layers of the GIS file as a list
gisvaluesReturns the values from a feature in a GIS file from its index
typstcompileconvert the typst content into pdf/svg/png
typstsvg2pdfconvert the svg content into pdf or png (or svg)

Node Functions

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

Network Functions

PluginFunctionHelp

| ATTRS | nodemap | Generate attribute map for the given attribute for the nodes | | ATTRS | set_attrs_render | Set network attributes based on string templates | | ATTRS | set_attrs | Set network attributes | | ATTRS | set_node_attrs | Set node attributes in a network using a attrmap or array | | COMMAND | command | Run the given template as a shell command. | | COMMAND | parallel | Run the given template as a shell command for each nodes in the network in parallel. | | CONN | load_edges | Load the given edges as a network | | CONN | load_file | Load the given file into the network | | CONN | load_str | Load network from the given string | | CONN | save_file | Save the network into the given file | | CONN | subset_from | Take a subset of network by taking the given node as a new outlet | | CONN | subset_largest | Take a subset of network by only including the largest blob of connected nodes | | CONN | subset | Take a subset of network by only including the selected nodes | | CORE | count | Count the number of nodes in the network | | CORE | net_leaves | Get the name of the leaf nodes | | CORE | net_roots | Get the name of the outlet nodes | | CORE | node_attr | Get the attr of the provided node | | CORE | node_map | Get a attrmap with node name and attributes | | GVIZ | load_positions | Load Node positions from the graphviz file | | GVIZ | save_gv | Save the network as a graphviz file | | RENDER | render_nodes | Render each node of the network and combine to same variable | | RENDER | render_template | Render a File template for the nodes in the whole network | | RENDER | render | Render from network attributes | | TABLE | save_csv | Save CSV | | TABLE | table_to_markdown | Render the Table as a rendered markdown | | TS | series_csv | Write the given nodes to csv with given attributes and series | | TS | ts_print_csv | Save timeseries from all nodes into a single csv file | | VISUALS | flatten | | | VISUALS | set_nodesize_attrs | Set the node size of the nodes based on the attribute value | | VISUALS | svg_save | Exports the network as a svg | | VISUALS | svg_ts_blocks | | | cairo | network | Create a SVG file with the given network structure | | cairo | table | Create a SVG file with the given network structure | | csv | load_series | Load series values to nodes | | csv | load_timeseries | Load timeseries values to nodes | | gis | load_attrs | Load node attributes from a GIS file | | gis | load_network | Load network from a GIS file | | gis | save_connections | Save GIS file of the connections | | gis | save_nodes | Save GIS file of the nodes | | typst | table | Generate Typst code for given Table |