rsatoolbox.util.file_io module

saving to and reading from files

rsatoolbox.util.file_io.read_dict_hdf5(file)[source]

writes a nested dictionary containing strings & arrays as data into a hdf5 file

Parameters

file – a filename or opened readable file

Returns

the loaded dict

Return type

dictionary(dict)

rsatoolbox.util.file_io.read_dict_pkl(file)[source]

writes a nested dictionary containing strings & arrays as data into a pickle file

Parameters

file – a filename or opened readable file

Returns

the loaded dict

Return type

dictionary(dict)

rsatoolbox.util.file_io.remove_file(file)[source]

Deletes file from OS if it exists

Parameters

file (str, Path) – a filename or opened readable file

rsatoolbox.util.file_io.write_dict_hdf5(file, dictionary)[source]

writes a nested dictionary containing strings & arrays as data into a hdf5 file

Parameters
  • file – a filename or opened writable file

  • dictionary (dict) – the dict to be saved

rsatoolbox.util.file_io.write_dict_pkl(file, dictionary)[source]

writes a nested dictionary containing strings & arrays as data into a pickle file

Parameters
  • file – a filename or opened writable file

  • dictionary (dict) – the dict to be saved