The pyminizip module provides simple support for creating password-protected Zip archives. For other things you might want to do with Zip files (e.g. extraction), you can use the zipfile module from the standard library.
Create a password-protected zip archive from a single file. The level parameter determines the compression level, 0 is the default, other possible values are 1 (fastest) to 9 (most compression).
Create a password-protected zip archive from a list of file paths. The level parameter determines the compression level, 0 is the default, other possible values are 1 (fastest) to 9 (most compression).
The optional progress parameter is a callback function with one argument that will be called during compression with the number of files that have been compressed so far.