add_to_zip
add_to_zip#
- add_to_zip(zip_path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], dirs_to_add: Union[list, str, cloudpathlib.cloudpath.CloudPath, pathlib.Path]) Union[cloudpathlib.cloudpath.CloudPath, pathlib.Path] [source]#
Add folders to an already existing zip file (recursively).
>>> zip_path = 'D:/path/to/zip.zip' >>> dirs_to_add = ['D:/path/to/dir1', 'D:/path/to/dir2'] >>> add_to_zip(zip_path, dirs_to_add) >>> # zip.zip contains 2 more folders, dir1 and dir2