miurahr / py7zr

7zip in python3 with ZStandard, PPMd, LZMA2, LZMA1, Delta, BCJ, BZip2, and Deflate compressions, and AES encryption.
https://pypi.org/project/py7zr/
GNU Lesser General Public License v2.1
462 stars 74 forks source link

Is there an option to split to volumes? #557

Closed CelebStalker closed 7 months ago

CelebStalker commented 9 months ago

Can someone help with the code for the GUI? image

miurahr commented 9 months ago

You can find a manual explanation of multi-volume at https://py7zr.readthedocs.io/en/latest/user_guide.html#extraction-from-multi-volume-archive

If you want to create multi volume archive using multivolumefile library, following example do it for you.

import multivolumefile
import py7zr

target = pathlib.Path('/target/directory/')
with multivolumefile.open('example.7z', mode='wb', volume_size=10240) as target_archive:
    with SevenZipFile(target_archive, 'w') as archive:
        archive.writeall(target, 'target')