Skip to main content

A simple python package that builds on top of the standart library ZipFile, which allows user to update files inside a zip archive with ease.

Project description

UpdateableZipFile

UpdateableZipFile is a simple python package base on a stack overflow answer.

It implements a single class, UpdateableZipFile, that builds on top of the standart library ZipFile, which allows user to update files inside a zip archive with ease.

Example

from updateablezipfile import UpdateableZipFile

with UpdateableZipFile("C:\Temp\Test2.docx", "a") as o:
    # Overwrite a file with a string
    o.writestr("word/document.xml", "Some data")
    # exclude an exiting file from the zip
    o.remove_file("word/fontTable.xml")
    # Write a new file (with no conflict) to the zp
    o.writestr("new_file", "more data")
    # Overwrite a file with a file
    o.write(r"C:\Temp\example.png", "word/settings.xml")

Attribution

The implementation is was in no way or form written by me, it is thanks to Or Weis answer on stack overflow.

As of my knowledge this is code is under the Creative Commons license, based on the terms and conditions of stack overflow.

If you are the original author of the underlying implementation please contact me and i will transfer the package over to you.

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

updateable-zip-file-0.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

updateable_zip_file-0.0.1-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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