With reference to this article and specifications documentation, I do not specify anything when unzipping (
zip_f.extractall()), but why don't you specify a folder name to unzipping to?
With Python's 74th Python, starting from scratch, you can extract 100 files to spare
The following is an example of extracting a ZIP file called "test.zip" and expanding it below the folder called "test".
After saving the above program as test-unzip.py, launch IDLE in Python's running environment.Try loading and running the program from the IDLE menu File>Open. If successful, the contents of the ZIP file will be extracted below the folder called test.
Expand all members from the archive to the current working directory.path specifies the directory to deploy to.
This article is not
extract(), but it is the same.
How to unzip specific folder from a.zip with Python
Or, if you want to keep the hierarchy as it is now, why don't you rename the
XBRLData folder with
os.rename() immediately after unzipping?
Change the filename or directory name
In any case, it seems that the target folder name is either an extension removed from the ZipFile file name, or something has been done based on it.
The path element ends with no extensions:
© 2023 OneMinuteCode. All rights reserved.