Metadata-Version: 2.2
Name: zipmanager
Version: 0.5.2
Summary: Allows you to manage zip folders as data
Home-page: https://github.com/SimplePythonCoder/zipmanager
Author: SimplePythonCoder
Author-email: 
License: MIT
Project-URL: Source, https://github.com/SimplePythonCoder/zipmanager
Project-URL: Changelog, https://github.com/SimplePythonCoder/zipmanager/blob/main/CHANGELOG.md
Project-URL: Documentation, https://github.com/SimplePythonCoder/zipmanager/wiki
Project-URL: Issues, https://github.com/SimplePythonCoder/zipmanager/issues
Keywords: zip,zipfile
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# zipmanager
[![downloads](https://static.pepy.tech/badge/zipmanager)](https://www.pepy.tech/projects/zipmanager) [![changelog](https://raw.githubusercontent.com/SimplePythonCoder/zipmanager/main/images/Changelog.svg)](https://github.com/SimplePythonCoder/zipmanager/blob/main/CHANGELOG.md) [![wiki](https://raw.githubusercontent.com/SimplePythonCoder/zipmanager/main/images/Wiki.svg)](https://github.com/SimplePythonCoder/zipmanager/wiki)
```
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
```python
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
```python
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:
```python
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:
```python
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
```
