collect_files

salsa.utils.collect_files(directory, file_ext='.h5', key_words=[], black_list=[])

Finds and returns files in a given directory with given extension. Optional key_word and black_list requirements

Parameters:
  • directory (str) – Directory in which to search for files

  • file_ext (str) – The file extension to look for (ie ‘.py’, ‘.h5’)

  • key_words (list of str) – Key words that must in the filename to be collected

  • black_list (list of str) – list of files to exclude from collection

Returns:

files – List of filenames in the directory that pass all requirements for file extension, keywords, black_list.

Return type:

list of str