epicsarchiver_mgmt.input_parsing

Parse the input csv file.

Attributes

LOG

Exceptions

ParseCSVRowError

Exception for when the csv file is invalid.

Functions

parse_csv(→ dict[str, list[str]])

Parse the csv file.

single_column_csv(→ collections.abc.Sequence[str])

Parse the csv file with a single column.

double_column_csv(...)

Parse the csv file with two columns.

Module Contents

epicsarchiver_mgmt.input_parsing.LOG: logging.Logger[source]
exception epicsarchiver_mgmt.input_parsing.ParseCSVRowError(row: list[str] | None = None)[source]

Bases: epicsarchiver_mgmt.exceptions.BaseMgmtError

Exception for when the csv file is invalid.

row = None[source]
epicsarchiver_mgmt.input_parsing.parse_csv(file: TextIO, expected_columns: int) dict[str, list[str]][source]

Parse the csv file.

Parameters:
  • file (TextIOWrapper) – The file to parse.

  • expected_columns (int) – The expected number of columns in csv file

Returns:

The list of tuples of PVs.

Return type:

list[tuple[str, …]]

Raises:

ParseCSVRowError – If the file is invalid.

epicsarchiver_mgmt.input_parsing.single_column_csv(file: TextIO) collections.abc.Sequence[str][source]

Parse the csv file with a single column.

Parameters:

file (TextIOWrapper) – The file to parse.

Returns:

The list of PVs.

Return type:

list[str]

epicsarchiver_mgmt.input_parsing.double_column_csv(file: TextIO) collections.abc.Sequence[tuple[str, str]][source]

Parse the csv file with two columns.

Parameters:

file (TextIOWrapper) – The file to parse.

Returns:

The dictionary of PVs.

Return type:

dict[str, str]