- validate_filepath(fpath, file_extension, exception_type)
Validate an input filepath.
The input is verified to be a string with a valid ending, and it is validated that the file exists on disk. If any of these conditions are not met, an exception is raised.
fpath (str) – Filepath to validate.
file_extension (str or iterable of str) – A single file extension or an iterable of acceptable file extensions for the input path.
exception_type (Exception) – A class indicating the type of exception to raise if file extension is incorrect.