alf.folders

alf.folders.find_sessions(folder: Union[str, pathlib.Path]) → List[str]

Returns all sessions found in all subfolders of a main data folder

alf.folders.find_subject_folders(folder: Union[str, pathlib.Path]) → List[pathlib.Path]

Returns all subject folders found from a main data folder

alf.folders.find_subject_names(folder: Union[str, pathlib.Path]) → List[str]

Returns all subject names found from a main data folder

alf.folders.next_num_folder(session_date_folder: str) → str

Return the next number for a session given a session_date_folder

alf.folders.remove_empty_folders(folder: Union[str, pathlib.Path]) → None

Will iteratively remove any children empty folders

alf.folders.session_name(path: Union[str, pathlib.Path]) → str

Returns the session name (subject/date/number) string for any filepath useing session_path

alf.folders.session_path(path: Union[str, pathlib.Path]) → str

Returns the session path from any filepath if the date/number pattern is found

alf.folders.subjects_data_folder(folder: pathlib.Path, rglob: bool = False) → pathlib.Path

Given a root_data_folder will try to find a ‘Subjects’ data folder. If Subjects folder is passed will return it directly.