I have used os.walk()
to get the list of files to a DataFrame. Now I want to extract the zip folders from the list of files in the DataFrame.
DataFrame
file_name base_name extension absolute_path rel_path
file_1.pdf file_1 pdf C:\\temp\documents\file_1.pdf \file_1.pdf
file_2.zip file_2 zip C:\\temp\documents\file_2.zip \file_2.zip
file_3.7z file_3 7z C:\\temp\documents\file_3.7z \file_3.7z
file_4.tar file_4 tar C:\\temp\documents\file_4.tar \file_4.tar
- I am using python shutil package for extracting/unzipping the contents. How can I do that?
- I am also looking for other file formats (.7z, .tar) as well in the same directory if they are available.
- The extracted folders should be in the same directory with the same name as well.
Note: cant change the package used for the extraction. only shutil package.