All Plugin Functions
All the functions available on this instance of nadi, are listed here.
Env Functions
| Plugin | Function | Help |
|---|---|---|
ATTRS | float_div | Float Division (same as / operator) |
ATTRS | float_mult | Float Multiplication (same as * operator) |
ATTRS | get | get the choosen attribute from Array or AttrMap |
ATTRS | keys | keys of the attribute map |
ATTRS | parse_attr | Parse attribute from string |
ATTRS | parse_attrmap | Parse attribute map from string |
ATTRS | strmap | map values from the attribute based on the given table |
ATTRS | values | values of the attribute map |
COMMAND | command | Runs a command in terminal and returns attribute map |
COMMAND | set_shell_env | Set environment variable in the shell |
COMMAND | shell_env | Get environment variable from the shell |
CORE | append | append a value to an array |
CORE | array | make an array from the arguments |
CORE | assert_eq | Assert the two values are equal |
CORE | assert_neq | Assert the two values are not equal |
CORE | assert | Assert the condition is true |
CORE | attrmap | make an attrmap from the arguments |
CORE | concat | Concat the strings |
CORE | count_str | Get a count of unique string values |
CORE | count | Count the number of true values in the array |
CORE | day | day from date/datetime |
CORE | drop_nan | append a value to an array |
CORE | flatten | flatten the given list of arrays into a single one |
CORE | float | make a float from value |
CORE | hour | hour from time/datetime |
CORE | insert | Insert a key and value to a attrmap |
CORE | int | make an int from the value |
CORE | isinf | check if a float is +/- infinity |
CORE | isna | check if a float is nan |
CORE | json | format the attribute as a json string |
CORE | length | length of an array or hashmap |
CORE | max_num | Minimum of the variables |
CORE | max | Maximum of the variables |
CORE | min_num | Minimum of the variables |
CORE | min | Minimum of the variables |
CORE | minute | minute from time/datetime |
CORE | month | month from date/datetime |
CORE | nanosecond | nanosecond from time/datetime |
CORE | now | get the current date time |
CORE | prod | Product of the variables |
CORE | range | Generate integer array, end is not included |
CORE | second | second from time/datetime |
CORE | str_quote | Convert string to double quoted form |
CORE | str | make a string from value |
CORE | sum | Sum of the variables |
CORE | timediff | get the current date time |
CORE | to_attrmap | make an attrmap from a list of (k, v) |
CORE | today | get the current date |
CORE | type_name | Type name of the arguments |
CORE | unique_str | Get a list of unique string values |
CORE | year | year from date/datetime |
CORE | zip | make an array combining the arrays from arguments |
DEBUG | clip | Echo the ----8<---- line for clipping syntax |
DEBUG | debug | Print the args and kwargs on this function |
DEBUG | echo | Echo the string to stdout or stderr |
DEBUG | sleep | sleep for given number of milliseconds |
FILES | exists | Checks if the given path exists |
FILES | from_file | Reads the file contents as string |
FILES | line | Checks if the given path exists |
FILES | to_file | Writes the string to the file |
LOGIC | all | check if all of the bool are true |
LOGIC | and | Boolean and |
LOGIC | any | check if any of the bool are true |
LOGIC | eq | Equality than check |
LOGIC | gt | Greater than check |
LOGIC | ifelse | Simple if else condition |
LOGIC | lt | Less than check |
LOGIC | not | boolean not |
LOGIC | or | boolean or |
MATH | exp | Exponential |
MATH | log | Logarithm of a value, natural if base not given |
MATH | powf | Float power |
MATH | powi | Integer power |
MATH | sqrt | Square Root |
OPTIMUM | uniform_crossing_over | Crossing over of linear genes from two parent given uniform probability |
RANDOM | random_bool | Random bool given uniform probability |
REGEX | str_count | Count the number of matches of given pattern in the string |
REGEX | str_filter | Filter from the string list with only the values matching pattern |
REGEX | str_find_all | Find all the matches of the given pattern in the value |
REGEX | str_find | Find the given pattern in the value |
REGEX | str_join | Join the list of strings with the given string |
REGEX | str_match | Check if the given pattern matches the value or not |
REGEX | str_replace | Replace the occurances of the given match |
REGEX | str_split | Split the string with the given pattern |
RENDER | render | Render the template based on the node attributes |
VISUALS | image | |
VISUALS | svg_open_multi | |
VISUALS | svg_open | |
VISUALS | svg_settings | Generate the margins for the SVGs |
csv | count_data | Count the number of data in a column from a CSV file |
csv | count_usgs_years | Count the number of data in a column from a CSV file |
csv | schema | List the columns in a CSV file |
gis | features_count | Show the fields in the GIS file layer as a list |
gis | fields | Show the fields in the GIS file layer as a list |
gis | layers | Show the layers of the GIS file as a list |
gis | line | Show the layers of the GIS file as a list |
gis | values | Returns the values from a feature in a GIS file from its index |
typst | compile | convert the typst content into pdf/svg/png |
typst | svg2pdf | convert the svg content into pdf or png (or svg) |
Node Functions
| Plugin | Function | Help |
|---|---|---|
ATTRS | del_attrs | Delete attributes from the given node |
ATTRS | first_attr | Return the first Attribute that exists |
ATTRS | get_attr | Retrive attribute |
ATTRS | get_attrs | Retrive multiple attributes |
ATTRS | has_attr | Check if the attribute is present |
ATTRS | load_attrs | Loads attrs from file for all nodes based on the given template |
ATTRS | load_toml_render | Set node attributes by loading a toml from rendered template |
ATTRS | print_all_attrs | Print all attrs in a node |
ATTRS | print_attrs | Print the given node attributes if present |
ATTRS | set_attrs_ifelse | if else condition with multiple attributes |
ATTRS | set_attrs_render | Set node attributes based on string templates |
ATTRS | set_attrs | Set node attributes |
COMMAND | command | Run the given template as a shell command. |
COMMAND | run | Run the node as if it’s a command if inputs are changed |
CONN | move_aside | Move the node to the side so that its inputs go to the output |
CORE | has_output | Node has an output or not |
CORE | inputs_attr | Get attributes of the input nodes |
CORE | inputs_count | Count the number of input nodes in the node |
CORE | inputs_map | Get attributes of the input nodes in map format |
CORE | output_attr | Get attributes of the output node |
FILES | exists | Checks if the given path exists when rendering the template |
RENDER | render | Render the template based on the node attributes |
SERIES | set_series | set the following series to the node |
SERIES | sr_count | Number of series in the node |
SERIES | sr_delete | Delete the series with the given name |
SERIES | sr_dtype | Type name of the series |
SERIES | sr_fill | Fill the series with a value |
SERIES | sr_get | get nth member of a series |
SERIES | sr_len | Length of the series |
SERIES | sr_list | List all series in the node |
SERIES | sr_max | Get maximum value of the series |
SERIES | sr_mean | Mean of a series values |
SERIES | sr_min | Get minimum value of the series |
SERIES | sr_sort | Sort an series |
SERIES | sr_sum | Sum of the series values |
SERIES | sr_to_array | Make an array from the series if it’s complete |
TS | ts_complete | Convert the timeseries to complete if it doesn’t have gaps |
TS | ts_count | Number of timeseries in the node |
TS | ts_delete | Delete the timeseries with the given name |
TS | ts_dtype | Type name of the timeseries |
TS | ts_len | Length of the timeseries |
TS | ts_list | List all timeseries in the node |
TS | ts_print | Print the given timeseries values in csv format |
VISUALS | get_xy | |
VISUALS | set_xy | |
csv | column | read a single column from a CSV file |
csv | node_name | Example Node function for the plugin |
Network Functions
| Plugin | Function | Help |
|---|
| 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 |