Env Functions
schema
env csv.schema(
path: 'PathBuf',
header: 'bool' = true,
dates: 'bool' = true
)
Arguments:
path: 'PathBuf'=> Path to the CSV fileheader: 'bool' = true=> CSV file has header rowdates: 'bool' = true=> Parse Dates in the file
List the columns in a CSV file
count_data
env csv.count_data(path: 'PathBuf', column: 'IntOrStr')
Arguments:
path: 'PathBuf'=> Path to the CSV filecolumn: 'IntOrStr'=> Name or Index of the column to load
Count the number of data in a column from a CSV file
Returns the number of valid data and the number of total rows
count_usgs_years
env csv.count_usgs_years(
path: 'PathBuf',
outfile: 'PathBuf',
year: 'Option < i64 >'
)
Arguments:
path: 'PathBuf'=> Path to the CSV fileoutfile: 'PathBuf'=> Output CSV fileyear: 'Option < i64 >'=> year dam affected
Count the number of data in a column from a CSV file
Returns the number of total rows and the number of valid data
Node Functions
column
node csv.column(
path: 'PathBuf',
column: 'IntOrStr',
dates: 'bool' = true,
name: 'Option < String >'
)
Arguments:
path: 'PathBuf'=> Path to the CSV filecolumn: 'IntOrStr'=> Name or Index of the column to loaddates: 'bool' = true=> Parse Dates in the filename: 'Option < String >'=> Name of the series defaults to column name
read a single column from a CSV file
node_name
node csv.node_name()
Arguments:
Example Node function for the plugin
Network Functions
load_series
network csv.load_series(
path: 'PathBuf',
name: 'String',
nodemap: 'Option < HashMap < String, String > >',
dates: 'bool' = true
)
Arguments:
path: 'PathBuf'=> Path to the CSV filename: 'String'=> Name of the Seriesnodemap: 'Option < HashMap < String, String > >'=> HashMap of column name to Node namedates: 'bool' = true=> Parse Dates in the file
Load series values to nodes
network csv.load_series("/home/gaurav/work/nadi-project/codes/nadi_csv/test.csv", "test")
load_timeseries
network csv.load_timeseries(
path: 'PathBuf',
datecol: 'String',
name: 'String',
datefmt: 'String' = "%Y-%m-%d",
nodemap: 'Option < HashMap < String, String > >',
dates: 'bool' = true
)
Arguments:
path: 'PathBuf'=> Path to the CSV filedatecol: 'String'=> Name of the column with datetimename: 'String'=> Name of the Seriesdatefmt: 'String' = "%Y-%m-%d"=> Date Format to save the datesnodemap: 'Option < HashMap < String, String > >'=> HashMap of column name to Node namedates: 'bool' = true=> Parse Dates in the file
Load timeseries values to nodes
network csv.load_timeseries("/home/gaurav/work/nadi-project/codes/nadi_csv/test.csv", "date", "test")