caf.toolkit.io#

Common utility functions for file input and output.

Module Attributes

NORMALISED_CHARACTERS

Characted allowed in normalised column names.

Functions

find_file_with_name(folder, name, suffixes)

Find a file in a folder matching _any_ acceptable suffix.

read_csv(path[, name, normalise_column_names])

Read CSV files, wraps pandas.read_csv to perform additional checks.

read_csv_matrix(path[, format_])

Read matrix CSV in the square or long format.

safe_dataframe_to_csv(df, *args, **kwargs)

Prompt the user to close a file before saving.

Classes

Any(*args, **kwargs)

Special type indicating an unconstrained type.

Callable()

Hashable()

Iterable()

Sequence()

All the operations on a read-only sequence.

TypeVar(name, *constraints[, bound, ...])

Type variable.

Exceptions

MissingColumnsError(name, columns, *args, ...)

Raised when columns are missing from input CSV.

Attributes Documentation

caf.toolkit.io.NORMALISED_CHARACTERS = 'abcdefghijklmnopqrstuvwxyz0123456789!#$%£&\\-.<=>+^_~\\(\\)'#

Characted allowed in normalised column names.