file_system

aitoolbox.utils.file_system.create_folder_hierarchy(base_folder_path, folder_names)[source]

Create nested folder hierarchy

Parameters:
  • base_folder_path (str) – folder from which the created folder hierarchy will go into further depth

  • folder_names (list) – names of folders to be created one inside the previous

Returns:

path to final folder in hierarchy, all the folder paths in the created hierarchy

Return type:

str, list

aitoolbox.utils.file_system.zip_folder(source_dir_path, zip_path)[source]

Utility function for zipping a folder into .zip archive

Parameters:
  • source_dir_path (str) – path to the folder that is going to be zipped

  • zip_path (str) – specify the path of the zip file which will be created

Returns:

the full path to the produced zip file (with the .zip extension appended)

Return type:

str

aitoolbox.utils.file_system.unzip_file(file_path, target_dir_path)[source]

Util function for zip file unzipping

Parameters:
  • file_path (str) – path to the zip file

  • target_dir_path (str) – destination where unzipped content is stored