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 $ 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.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: appendzip-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for appendzip-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f985d79afcad75d7e6025c801581f1558ef2d73e20c67cdb7a821ea9a9ea9017
MD5 8214782c67b0a5c6e5791d7c054d5a62
BLAKE2b-256 9d442f0a217a83107611a6546867d0d0af878aff8917eee673edee0290576865

See more details on using hashes here.

File details

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

File metadata

  • Download URL: appendzip-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for appendzip-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ada0e7e824736eebd36932455726651b83a0c3d3cb8be1411215ca631111d737
MD5 43107d3c1b2fb2dbeaa3c287dba4a594
BLAKE2b-256 96c0f4755c6a3a59ee7a33064372ed418fc86988b42041fb041171edf1a47213

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 Pingdom Monitoring Sentry Error logging StatusPage Status page