0

i know there is a module called ZipFile with LZMA, but how can i use LZMA2 multithread? I've tried the ZipFile and backports modules, but (apparently) neither of the 2 have that option.

jhown
  • 1
  • 1

1 Answers1

0

There is a library in python called py7zr (https://pypi.org/project/py7zr/)

It currently doesn't support (and it is not said anywhere) multithreading, but it has got LZMA2 compression. To do that you can simply write that code Install

!pip install py7zr

and then

import py7zr

my_filter = [{"id": py7zr.FILTER_LZMA2 , "preset": 7}]
with py7zr.SevenZipFile('target.7z', 'w', filters=my_filter) as archive:
    archive.writeall('/path/to/base_dir', 'base') # in first parameter choose what you want to store and this is it !