Skip to main content

Append a single file to zip, overwriting the existing file if necessary

Project description

append-zip

Appends a file to a zip file, overwriting the existing file there if necessary

Performance

Not efficient; extracts all the files in the zip, copies over the new file, and compresses a brand new zip replacing the original one. You will need enough disk space to duplicate the zip file.

Caveats

for some reason, windows has a different file length after unzipping (by 10-20 bytes). So beware how this works on windows

Getting started

install (on Mac) $ python3 -m pip install appendzip

from appendzip.appendzip import appendzip
# before appendzip calendar.txt in the zip archive test.zip contains 2021-01-02
# before appendzip calendar.txt outside the zip contains 2022-02-03
appendzip(
            pathlib.Path('test.zip'),
            pathlib.Path('calendar.txt'),
            'calendar.txt'
)
# after appendzip calendar.txt inside the zip contains 2022-02-03
# after, there is still only one file in the zip archive test.zip

Project details


Download files

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

Source Distribution

appendzip-0.0.5.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

appendzip-0.0.5-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file appendzip-0.0.5.tar.gz.

File metadata

  • Download URL: appendzip-0.0.5.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for appendzip-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0d603b7fd66e377f29b2aeafe02d04a5a0fd3bfe4664125fcecd7844771f4437
MD5 ef359f0de5376ebbaa40e7fd86101d14
BLAKE2b-256 ac1d57169d7c0cebff9e7b6e3532e0ac9047ed174bd2929d94f0d70fa38694ab

See more details on using hashes here.

File details

Details for the file appendzip-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: appendzip-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for appendzip-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 06ec56072fbb57c43a0fbc62748fde3e39354b3bab1dfe16effab777837dc128
MD5 f323a4c99e431b54ae4f9a64101377db
BLAKE2b-256 b5a8febe4b444a8899b7bcba94e0fea5c786b12af2fb812ea08f8f184a9ed383

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page