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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file updateable-zip-file-0.0.1.tar.gz.

File metadata

  • Download URL: updateable-zip-file-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for updateable-zip-file-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d614e832a4c45203fc9d88353edb08a5b99128d30f648c83fb9b164646d4506e
MD5 3128053fa99485f791dec65f941576f0
BLAKE2b-256 dc418d91b978ecd0dc3e7a0cab38f222b9e1cf0988d122afbe29eaf386761ddb

See more details on using hashes here.

File details

Details for the file updateable_zip_file-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for updateable_zip_file-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6b1829638658c51b89b981625cb0715617a0dc9389676cab507762ac60015d6
MD5 91e3a7aa2f2a965e4294f2aa4aae60d9
BLAKE2b-256 0a0c7a3ea7c98702afa1347a8526c5a43c9334eaf57fafa86ed126b577f6f0d0

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