### Set up local development environment Source: https://github.com/danifus/pyzipper/blob/master/CONTRIBUTING.rst Commands to create a virtual environment and install dependencies for development. ```shell $ mkvirtualenv pyzipper $ cd pyzipper/ $ pip install -e . $ pip install -r requirements_dev.txt ``` -------------------------------- ### Install pyzipper Source: https://github.com/danifus/pyzipper/blob/master/README.rst Install the pyzipper library using pip. ```bash pip install pyzipper ``` -------------------------------- ### Conditionally Include CRC32 Values Source: https://github.com/danifus/pyzipper/blob/master/README.rst Example of how to conditionally include CRC32 values for files based on their uncompressed size. The minimum size to include CRC is set to 20 bytes. ```python with pyzipper.AESZipFile( 'new_test.zip', 'w', compression=pyzipper.ZIP_LZMA, ) as zf: zf.setencryption( pyzipper.WZ_AES, conditionally_include_crc=True, min_bytes_to_include_crc=, ) ... ``` -------------------------------- ### Deploy new version Source: https://github.com/danifus/pyzipper/blob/master/CONTRIBUTING.rst Commands for maintainers to bump the version and push tags to trigger deployment. ```shell $ bumpversion patch # possible: major / minor / patch $ git push $ git push --tags ``` -------------------------------- ### Basic Usage: Create and Read Encrypted Zip Source: https://github.com/danifus/pyzipper/blob/master/README.rst Demonstrates how to create a new AES encrypted zip file and then read from it. Requires setting a password and specifying encryption details. ```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') ``` -------------------------------- ### Create a development branch Source: https://github.com/danifus/pyzipper/blob/master/CONTRIBUTING.rst Command to switch to a new branch for implementing changes. ```shell $ git checkout -b name-of-your-bugfix-or-feature ``` -------------------------------- ### Clone the pyzipper repository Source: https://github.com/danifus/pyzipper/blob/master/CONTRIBUTING.rst Use this command to create a local copy of the repository from your fork. ```shell $ git clone git@github.com:your_name_here/pyzipper.git ``` -------------------------------- ### Commit and push changes Source: https://github.com/danifus/pyzipper/blob/master/CONTRIBUTING.rst Commands to stage, commit, and push local changes to the remote repository. ```shell $ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Run a subset of tests Source: https://github.com/danifus/pyzipper/blob/master/CONTRIBUTING.rst Execute specific tests using py.test. ```shell $ py.test tests.test_pyzipper ``` -------------------------------- ### Run tests with tox Source: https://github.com/danifus/pyzipper/blob/master/CONTRIBUTING.rst Execute tests across multiple Python versions using tox. ```shell $ tox ``` -------------------------------- ### Configure AES Encryption Strength Source: https://github.com/danifus/pyzipper/blob/master/README.rst Shows how to set the AES encryption strength (128, 192, or 256 bits) when creating an encrypted zip file. Defaults to 256 bits. ```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=256) 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') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.