pyeda31.check_csv

Functions

check_csv(file_path)

Check if the given file has a CSV file extension and whether it can be read by the pandas library.

Module Contents

pyeda31.check_csv.check_csv(file_path)[source]

Check if the given file has a CSV file extension and whether it can be read by the pandas library.

Parameters:

file_path (str) – Path to the file.

Returns:

True if the file has a CSV extension and can be read by the pandas library. False otherwise (e.g., incorrect file extension or read error).

Return type:

bool

Examples

>>> from pyeda31.check_csv import check_csv
>>> check_csv("../data/raw/data.csv")
True
>>> check_csv("../data/raw/data.txt")
False