Allows you to manage zip folders as data
Project description
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
# ZipFile 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
data = zip_folder['file_name.json']
# will return a dict type
# same for .txt
file_data = {'key': 'value'}
zip_folder = ZipFolder({'file_name.txt': file_data})
data = zip_folder['file_name.txt']
# will return a string
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.1.0.tar.gz
(4.6 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.1.0.tar.gz.
File metadata
- Download URL: zipmanager-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
343da31c8139793e83db69891dcf6573b456e1940e7e0b8afe3a0d21c681b6b9
|
|
| MD5 |
6f5b94e429926c03ea2208c7a599ec88
|
|
| BLAKE2b-256 |
1df9eed60ee82a8f77e346af5e3da3a7b9f8a91c7a75fe8f89283bc091c75ccd
|
File details
Details for the file zipmanager-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zipmanager-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 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 |
e924304eba7efa9d5334e8ad0fa1a4f43c29409bbc32818d211b69ade875d861
|
|
| MD5 |
776d8101f3e77c515f9168be58c2f86a
|
|
| BLAKE2b-256 |
9559c97166c1479f02f469075bbff4dce724935c08e5fad1f044ce7924fdf06b
|