To create a password encrypted zip file in python. And the zip file is able to extract in WINDOWS.
This is a simple Minizip wrapper of python. (http://www.winimage.com/zLibDll/minizip.html)
This software uses zlib. License: zlib/libpng License.
$ pip install pyminizip
# linux
$ sudo apt-get install zlib
# mac
$ xcode-select --install
$ brew install zlib
This package just provides three functions.
pyminizip.compress("/srcfile/path.txt", "file_path_prefix", "/distfile/path.zip", "password", int(compress_level))
Args:
compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress) or 0 (default)
Return value:
pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], [u'/path_for_file1', u'/path_for_file2'], "file.zip", "1233", 4, progress)
Args:
optional function to be called during processing which takes one argument, the count of how many files have been compressed
Return value:
pyminizip.uncompress("/srcfile/path.zip", "password", "/dirtoextract", int(withoutpath))
Args:
withoutpath (exclude path of extracted)
Return value: