graphorge.ioput.iostandard.find_unique_file_with_regex

find_unique_file_with_regex(directory, regex)[source]

Find file in directory based on regular expression.

Returns first occurrence if file matching regular expression is found.

Parameters:
  • directory (str) – Directory where file is searched.

  • regex ({str, tuple[str]}) – Regular expression to search for file. If tuple of regular expressions is provided, then search procedure loops over them.

Returns:

  • is_file_found (bool) – True if file is found, False otherwise.

  • file_path ({str, None}) – File path. Set to None if file is not found.