Class: QgsZipUtils¶
Provides utility functions for working with zip files.
Added in version 3.0.
List of all members, including inherited members
Methods
Returns the list of files within a zip file |
Static Methods
Extracts a file from a zip archive, returns |
|
Returns |
|
Unzip a zip file in an output directory. |
|
Zip the list of files in the zip file. |
- class qgis.core.QgsZipUtils[source]¶
Bases:
object- static extractFileFromZip(zipFilename: str | None, filenameInZip: str | None)[source]¶
Extracts a file from a zip archive, returns
Trueon success.Added in version 4.0.
- files(zip: str | None) list[str][source]¶
Returns the list of files within a
zipfileAdded in version 3.30.
- Parameters:
zip (Optional[str])
- Return type:
list[str]
- static isZipFile(filename: str | None) bool[source]¶
Returns
Trueif the file name is a zipped file ( i.e with a ‘.qgz’ extension,Falseotherwise.- Parameters:
filename (Optional[str]) – The name of the file
- Return type:
bool
- Returns:
Trueif the file is zipped,Falseotherwise
- static unzip(zip: str | None, dir: str | None, checkConsistency: bool = True)[source]¶
Unzip a zip file in an output directory.
- Parameters:
- Return type:
(bool, list[str])
- Returns:
Falseif the zip filename does not exist, the output directory does not exist or is not writable.files: The absolute path of unzipped files