pyevoc.utils.io#

Input/output helpers.

pyevoc.utils.io.read_table(path, **kwargs)[source]#

Read a tabular data file into a pandas.DataFrame.

Dispatches to the appropriate pandas reader based on the file extension. Supported formats: .csv, .tsv / .tab, .xlsx / .xls, .parquet, and .json.

Parameters:
  • path (str | Path) – Path to the data file.

  • **kwargs – Extra keyword arguments forwarded to the underlying pandas reader.

Returns:

A DataFrame containing the file contents.

Raises:

ValueError – If the file extension is not supported.

Return type:

DataFrame

pyevoc.utils.io.ensure_dir(path)[source]#

Create path and all missing parent directories, then return it.

Equivalent to mkdir -p; safe to call on a directory that already exists.

Parameters:

path (str | Path) – Directory path to create.

Returns:

The resolved Path object.

Return type:

Path