All Plugin Functions
All the functions available on this instance of nadi, are listed here.
Env Functions
| Plugin | Function | Help |
|---|---|---|
DEBUG | echo | Echo the string to stdout or stderr |
ATTRS | keys | |
CORE | float | make a float from value |
MATH | exp | Exponential |
MATH | log | Logarithm of a value, natural if base not given |
CONN | root_node | default name used for ROOT node of the network |
CORE | count_str | Get a count of unique string values |
CORE | assert_neq | Assert the two values are not equal |
FILES | line | Checks if the given path exists |
CORE | attrmap | make an attrmap from the arguments |
CORE | assert_eq | Assert the two values are equal |
gis | fields | Show the fields in the GIS file layer as a list |
gis | values | Returns the values from a feature in a GIS file from its index |
CORE | append | append a value to an array |
CORE | day | day from date/datetime |
CORE | count | Count the number of true values in the array |
CORE | range | Generate integer array, end is not included |
REGEX | str_filter | Filter from the string list with only the values matching pattern |
csv | schema | List the columns in a CSV file |
csv | count_usgs_years | Count the number of data in a column from a CSV file |
ATTRS | float_div | Float Division (same as / operator) |
ATTRS | parse_attrmap | Parse attribute map from string |
CORE | unique_str | Get a list of unique string values |
CORE | min_num | Minimum of the variables |
LOGIC | not | boolean not |
CORE | str | make a string from value |
CORE | isna | check if a float is nan |
LOGIC | all | check if all of the bool are true |
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 |
CORE | json | format the attribute as a json string |
FILES | to_file | Writes the string to the file |
CORE | drop_nan | append a value to an array |
ATTRS | parse_attr | Parse attribute from string |
CORE | concat | Concat the strings |
CORE | assert | Assert the condition is true |
CORE | year | year from date/datetime |
REGEX | str_count | Count the number of matches of given pattern in the string |
VISUALS | svg_settings | Generate the margins for the SVGs |
CORE | max | Maximum of the variables |
CORE | type_name | Type name of the arguments |
LOGIC | ifelse | Simple if else condition |
DEBUG | sleep | sleep for given number of milliseconds |
REGEX | str_match | Check if the given pattern matches the value or not |
CORE | max_num | Minimum of the variables |
LOGIC | any | check if any of the bool are true |
gis | line | Show the layers of the GIS file as a list |
CORE | array | make an array from the arguments |
CORE | min | Minimum of the variables |
FILES | exists | Checks if the given path exists |
CORE | sum | Sum of the variables |
LOGIC | gt | Greater than check |
MATH | powi | Integer power |
csv | count_data | Count the number of data in a column from a CSV file |
CORE | length | length of an array or hashmap |
LOGIC | lt | Less than check |
LOGIC | or | boolean or |
COMMAND | shell_env | Get environment variable from the shell |
MATH | sqrt | Square Root |
ATTRS | get | get the choosen attribute from Array or AttrMap |
CORE | int | make an int from the value |
CORE | flatten | flatten the given list of arrays into a single one |
CORE | month | month from date/datetime |
COMMAND | command | Runs a command in terminal and returns attribute map |
CORE | insert | Insert a key and value to a attrmap |
DEBUG | clip | Echo the ----8<---- line for clipping syntax |
CORE | isinf | check if a float is +/- infinity |
gis | features_count | Show the fields in the GIS file layer as a list |
LOGIC | and | Boolean and |
LOGIC | eq | Equality than check |
RENDER | render | Render the template based on the node attributes |
MATH | powf | Float power |
ATTRS | float_mult | Float Multiplication (same as * operator) |
REGEX | str_replace | Replace the occurances of the given match |
json | load_json | Loads JSON file as a AttrMap |
ATTRS | strmap | map values from the attribute based on the given table |
gis | layers | Show the layers of the GIS file as a list |
DEBUG | debug | Print the args and kwargs on this function |
CORE | str_quote | Convert string to double quoted form |
CORE | prod | Product of the variables |
COMMAND | set_shell_env | Set environment variable in the shell |
REGEX | str_split | Split the string with the given pattern |
FILES | from_file | Reads the file contents as string |
Node Functions
| Plugin | Function | Help |
|---|---|---|
SERIES | set_series | set the following series to the node |
RENDER | render | Render the template based on the node attributes |
FILES | exists | Checks if the given path exists when rendering the template |
ATTRS | first_attr | Return the first Attribute that exists |
TS | ts_dtype | Type name of the timeseries |
csv | node_name | Example Node function for the plugin |
CORE | inputs_attr | Get attributes of the input nodes |
json | load_json | Loads JSON file as a AttrMap |
ATTRS | set_attrs | Set node attributes |
ATTRS | load_attrs | Loads attrs from file for all nodes based on the given template |
CORE | inputs_count | Count the number of input nodes in the node |
SERIES | sr_dtype | Type name of the series |
SERIES | sr_sum | Sum of the series values |
TS | ts_count | Number of timeseries in the node |
TS | ts_complete | Convert the timeseries to complete if it doesn’t have gaps |
SERIES | sr_list | List all series in the node |
SERIES | sr_fill | Fill the series with a value |
ATTRS | has_attr | Check if the attribute is present |
ATTRS | del_attrs | Delete attributes from the given node |
COMMAND | run | Run the node as if it’s a command if inputs are changed |
ATTRS | set_attrs_render | Set node attributes based on string templates |
CORE | has_outlet | Node has an outlet or not |
CORE | output_attr | Get attributes of the output node |
TS | ts_len | Length of the timeseries |
TS | ts_print | Print the given timeseries values in csv format |
SERIES | sr_delete | Delete the series with the given name |
ATTRS | set_attrs_ifelse | if else condition with multiple attributes |
SERIES | sr_count | Number of series in the node |
SERIES | sr_to_array | Make an array from the series if it’s complete |
ATTRS | print_attrs | Print the given node attributes if present |
ATTRS | load_toml_render | Set node attributes by loading a toml from rendered template |
TS | ts_list | List all timeseries in the node |
COMMAND | command | Run the given template as a shell command. |
SERIES | sr_sort | Sort an series |
ATTRS | print_all_attrs | Print all attrs in a node |
SERIES | sr_len | Length of the series |
SERIES | sr_mean | Mean of a series values |
csv | column | read a single column from a CSV file |
SERIES | sr_get | get nth member of a series |
ATTRS | get_attr | Retrive attribute |
TS | ts_delete | Delete the timeseries with the given name |
Network Functions
| Plugin | Function | Help |
|---|---|---|
CORE | node_map | Get a attrmap with node name and attributes |
gis | load_attrs | Load node attributes from a GIS file |
gis | save_connections | Save GIS file of the connections |
CORE | node_attr | Get the attr of the provided node |
VISUALS | svg_ts_blocks | |
TS | series_csv | Write the given nodes to csv with given attributes and series |
CONN | subset_from | Take a subset of network by taking the given node as new outlet |
ATTRS | set_attrs | Set network attributes |
RENDER | render_nodes | Render each node of the network and combine to same variable |
CONN | load_str | Load network from the given string |
CONN | subset | Take a subset of network by only including the selected nodes |
COMMAND | command | Run the given template as a shell command. |
CORE | count | Count the number of nodes in the network |
TABLE | save_csv | Save CSV |
gis | load_network | Load network from a GIS file |
TABLE | table_to_markdown | Render the Table as a rendered markdown |
ATTRS | set_attrs_render | Set network attributes based on string templates |
CORE | outlet | Get the name of the outlet node |
CONN | load_edges | Load the given edges as a network |
COMMAND | parallel | Run the given template as a shell command for each nodes in the network in parallel. |
RENDER | render_template | Render a File template for the nodes in the whole network |
csv | load_series | Load series values to nodes |
CONN | subset_largest | Take a subset of network by only including the largest blob of connected nodes |
ATTRS | set_node_attrs | Set node attributes in a network using a attrmap |
VISUALS | set_nodesize_attrs | Set the node size of the nodes based on the attribute value |
CONN | save_file | Save the network into the given file |
VISUALS | svg_save | Exports the network as a svg |
graphviz | save | Save the network as a graphviz file |
gis | save_nodes | Save GIS file of the nodes |
RENDER | render | Render from network attributes |
TS | ts_print_csv | Save timeseries from all nodes into a single csv file |
CONN | load_file | Load the given file into the network |
csv | load_timeseries | Load timeseries values to nodes |