# pyzipper **Repository Path**: namele5s/pyzipper ## Basic Information - **Project Name**: pyzipper - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-29 - **Last Updated**: 2024-10-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README .. image:: https://img.shields.io/pypi/v/pyzipper.svg :target: https://pypi.org/project/pyzipper/ :alt: Current Version on PyPi .. image:: https://img.shields.io/pypi/pyversions/pyzipper.svg :target: https://pypi.org/project/pyzipper/ :alt: Supported Python Versions .. image:: https://img.shields.io/travis/danifus/pyzipper.svg :target: https://travis-ci.org/danifus/pyzipper :alt: Travis build (Linux/OsX) pyzipper ======== A 100% API compatible replacement for Python's ``zipfile`` that can read and write AES encrypted zip files. Callback function added to extracting zipfiles Installation ------------ .. code-block:: bash pip install pyzipper Usage ----- .. code-block:: python import pyzipper secret_password = b'lost art of keeping a secret' with pyzipper.AESZipFile('new_test.zip', 'w', compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES) as zf: zf.setpassword(secret_password) zf.writestr('test.txt', "What ever you do, don't tell anyone!") with pyzipper.AESZipFile('new_test.zip') as zf: zf.setpassword(secret_password) my_secrets = zf.read('test.txt') AES Strength ------------ The strength of the AES encryption can be configure to be 128, 192 or 256 bits. By default it is 256 bits. Use the ``setencryption()`` method to specify the encryption kwargs: .. code-block:: python import pyzipper secret_password = b'lost art of keeping a secret' with pyzipper.AESZipFile('new_test.zip', 'w', compression=pyzipper.ZIP_LZMA) as zf: zf.setpassword(secret_password) zf.setencryption(pyzipper.WZ_AES, nbits=128) zf.writestr('test.txt', "What ever you do, don't tell anyone!") with pyzipper.AESZipFile('new_test.zip') as zf: zf.setpassword(secret_password) my_secrets = zf.read('test.txt') Documentation ------------- Official Python ZipFile documentation is available here: https://docs.python.org/3/library/zipfile.html Credits ------- The docs skeleton was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. .. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage