Allows you to manage zip folders as data
Project description
zipmanager
pip install zipmanager
What does this package do ?
It allows you to create and handle zip folders as data without needing to save them.
Usage
from zipmanager import ZipFolder
file_data = b'some data'
zip_folder = ZipFolder({'file_name.file_extension': file_data})
# file extension not required
# ZipFolder will hold all the files given in the dictionary
file_data = zip_folder['file_name.file_extension']
# will return the file data
Main functions
from zipmanager import ZipFolder
file_data = b'some_data'
zip_folder = ZipFolder({'file_name.file_extension': file_data})
# list of functions:
zip_folder.add_files({'new_file': 'new_data'}) # add files to zip. read more at docstring.
zip_folder.delete_file('new_file') # removes file from zip
zip_folder.get('file_name') # returns None if file was not found
# or
zip_folder['file_name']
zip_folder.save() # saves zip in given location (empty is './temp.zip')
File extension features
json and text files data is automatically returned as a dict or str respectively:
from zipmanager import ZipFolder
file_data = b'{"key": "value"}'
zip_folder = ZipFolder({'file_name.json': file_data})
# .json extension is required to return a dict/list/str
data = zip_folder['file_name.json'] # returns a dict/list/str type
# same for .txt
file_data = b'text file data'
zip_folder = ZipFolder({'file_name.txt': file_data})
data = zip_folder['file_name.txt'] # returns a string
new in version 0.2.0 - files with the zip extension will return a ZipFolder object:
from zipmanager import ZipFolder
zip_data = b'some zip data'
zip_folder = ZipFolder({'file_name.zip': zip_data})
data = zip_folder['file_name.zip'] # returns a ZipFolder object
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zipmanager-0.5.2.tar.gz
(10.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zipmanager-0.5.2.tar.gz.
File metadata
- Download URL: zipmanager-0.5.2.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5144c255380bacc841daae2b4ef20a01b4975fa21d10da3d9f4fc18f7b11d0e
|
|
| MD5 |
ab2f4891612d633be0926707a3936816
|
|
| BLAKE2b-256 |
d5258531fe62bcfcc68b68fa8d2b5d54b15e2d578e5843fa6235ec98011af2ba
|
File details
Details for the file zipmanager-0.5.2-py3-none-any.whl.
File metadata
- Download URL: zipmanager-0.5.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7acd33bd5bcaa2787d3e72297b02f0d33ebd219f791d38dcc7840f1421a999e6
|
|
| MD5 |
f08fe7bd9e75283b92accca32a7ef51d
|
|
| BLAKE2b-256 |
ffd63b516ea21347e7631e9c49a3c51f56f020c9eca63b1eefed9f61795c4dc6
|