Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelvanstraten/updateable-zip-file
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.
https://github.com/michaelvanstraten/updateable-zip-file
file-modification files zipfiles
Last synced: 12 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/michaelvanstraten/updateable-zip-file
- Owner: michaelvanstraten
- Created: 2023-04-24T16:20:29.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-02T05:22:37.000Z (7 months ago)
- Last Synced: 2024-12-08T21:08:43.025Z (18 days ago)
- Topics: file-modification, files, zipfiles
- Language: Python
- Homepage: https://pypi.org/project/updateable-zip-file/
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# UpdateableZipFile
`UpdateableZipFile` is a simple python package base on a stack [overflow answer](https://stackoverflow.com/a/35435548).
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
```python
from updateablezipfile import UpdateableZipFilewith 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](https://stackoverflow.com/users/2899910/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.