tables

module of dascore.utils source

Utilities for reading strict CSV tables.

A table written by hand is read the way it was written: every cell arrives as text, the reader refuses a row which is not its header wide, and the value of a cell is decided by what the cell says rather than by whatever pandas inferred from the rows it happened to see.

These raise ParameterError and name the file with quote_path; a format which wants its own error type wraps them once, at whatever boundary reads its tables.

Functions

Name Description
ordered_rows Return the rows in the order the named column states, if any.
parse_cell Read a cell’s value the way its own text states it.
read_table Read one strict CSV table.
require_columns Refuse a table which does not carry a column it is read by.
require_stated Refuse a blank cell in a column the table is read by.
row_cells Return a row’s stated cells, an empty one meaning unset.