Skip to main content

Allows you to manage zip folders as data

Project description

zipmanager

alt

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


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.2.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zipmanager-0.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file zipmanager-0.2.0.tar.gz.

File metadata

  • Download URL: zipmanager-0.2.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for zipmanager-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ddfb06303bd3ed4e9f8c4332bd2c1e4cff09d918c79bdaba2713148a532394c2
MD5 ca5833a74ca0bbf8313952114e6a4d74
BLAKE2b-256 fc51d9137ea543263a90e9d97596963d4c4d16210a2f5789e6ec626d2996087c

See more details on using hashes here.

File details

Details for the file zipmanager-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: zipmanager-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for zipmanager-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bf39a6a05b35c3439bebcb7af4ff218aae64fdef07ccfb42899ca5668051c76
MD5 6b2ee23f84b48e17d848c51d61af21ff
BLAKE2b-256 6912f5b14e5fae4c919f3585d4fc4e51d64188c2d6a0a5dd5fc4d4f50509d3e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page