eoreader.reader.is_filename_valid

eoreader.reader.is_filename_valid

is_filename_valid(product_path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], regex: Union[list, re.Pattern]) bool[source]

Check if the filename corresponds to the given satellite regex.

Checks also if a file inside the directory is correct.

Warning

Two level max for the moment

Parameters
  • product_path (Union[str, CloudPath, Path]) – Product path

  • regex (Union[list, re.Pattern]) – Regex or list of regex

Returns

True if the filename corresponds to the given satellite regex

Return type

bool