crowsetta.validation.validate_ext#
- crowsetta.validation.validate_ext(file: str | bytes | PathLike | Path, extension: str | tuple) None [source]#
Check that a file has a valid extension.
- Parameters:
file (str, pathlib.Path) – Path to a file.
extension (str, tuple) – Valid file extension(s). Tuple must be tuple of strings. Function expects that extensions will be specified with a period, e.g. {‘.phn’, ‘.PHN’}