Delimited file¶
Create a CSV instance which can be used by param to get and run param sets
-
class
dapt.delimited_file.
Delimited_file
(csv_file, delimiter=', ')¶ An interface for accessing and setting paramater set data.
-
get_keys
()¶ Get the keys of the paramater set
Returns: Array of strings with each element being a key (order is preserved if possible)
-
get_row_index
(column_key, row_value)¶ Get the row index given the column to look through and row value to match to.
Parameters: - column_key (str) – the column to use.
- row_value (str) – the row value to match with in the file and determin the row index.
Returns: The index or -1 if it could not be determined
-
get_table
()¶ Get the table from the database.
Returns: An array with each element being a dictionary of the key-value pairs for the row in the database.
-
update_cell
(row_index, key, value)¶ Get the keys of the paramater set
Parameters: - row_index (int) – the row id to replace
- key (str) – the key of the value to replace
- value (str) – the value to insert into the cell
Returns: A boolean that is True if successfully inserted and False otherwise.
-
update_row
(row_index, values)¶ Get the keys of the paramater set
Parameters: - row_index (int) – the row id to replace
- values (OrderedDict) – the key-value pairs that should be inserted
Returns: A boolean that is True if successfully inserted and False otherwise.
-