Skip to main content

pyminizip

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.

Install

$ pip install pyminizip

Install zlib

# linux
$ sudo apt-get install zlib
# mac
$ xcode-select --install
$ brew install zlib

How to use

This package just provides three functions.

pyminizip.compress("/srcfile/path.txt", "file_path_prefix", "/distfile/path.zip", "password", int(compress_level))

Args:

  1. src file path (string)
  2. src file prefix path (string) or None (path to prepend to file)
  3. dst file path (string)
  4. password (string) or None (to create no-password zip)
  5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress) or 0 (default)

Return value:

  • always returns None
pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], [u'/path_for_file1', u'/path_for_file2'], "file.zip", "1233", 4, progress)

Args:

  1. src file LIST path (list)
  2. src file LIST prefix path (list) or []
  3. dst file path (string)
  4. password (string) or None (to create no-password zip)
  5. compress_level(int) between 1 to 9, 1 (more fast) <---> 9 (more compress)
  6. optional function to be called during processing which takes one argument, the count of how many files have been compressed

Return value:

  • always returns None
pyminizip.uncompress("/srcfile/path.zip", "password", "/dirtoextract", int(withoutpath))

Args:

  1. src file path (string)
  2. password (string) or None (to unzip encrypted archives)
  3. dir path to extract files or None (to extract in a specific dir or cwd)
  4. withoutpath (exclude path of extracted)

Return value:

  • always returns None

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyminizip-0.2.5.tar.gz (261.1 kB view details)

Uploaded Source

File details

Details for the file pyminizip-0.2.5.tar.gz.

File metadata

  • Download URL: pyminizip-0.2.5.tar.gz
  • Upload date:
  • Size: 261.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyminizip-0.2.5.tar.gz
Algorithm Hash digest
SHA256 95c3cb3ad838e1374534c8c3a4408e44eccc06598730c095de338d814fe09ccf
MD5 6220477294c2d0d174a49122eb628425
BLAKE2b-256 77f19740bcd637d0eaccb1c2ffb63b5a456a452f3f23fe26d8470f1b1ad6b399

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page