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
drop_private_columns Return a table without the columns which say they are not its own.
ordered_rows Return the rows in the order the named column states, if any.
parquet_table Return a dataframe as the parquet table it is written from.
parse_cell Read a cell’s value the way its own text states it.
read_parquet Read one parquet file, and whatever it states about itself.
read_parquet_metadata Return what a parquet file states about itself, reading no rows.
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.
write_parquet Write a dataframe as one parquet file, keeping the values it holds.
write_parquet_table Write a prepared parquet table, as parquet_table returns it.