miurahr / py7zr

7zip in python3 with ZStandard, PPMd, LZMA2, LZMA1, Delta, BCJ, BZip2, and Deflate compressions, and AES encryption.

Home Page:https://pypi.org/project/py7zr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python "zipfile" compatibility

upadsamay387 opened this issue · comments

Hi, I'm writing a script that handles multiple archive file types, and while zipfile and rarfile have the same methods and seemingly similar implementations, py7zr does not. This makes it a little annoying to make helper methods as I always have to handle incompatibilities between py7zr and other libraries.

For example:

def _copy_helper(archive, dst, member_prefix):

for file in archive.namelist():

...

Works fine for zipfile and rarfile, but not in py7zr since namelist() isn't implemented.

Thank you for suggestion. As always, your contribution and Pull-Request are welcome!
py7zr has already implement a feature which list a files in CLI, it will be very easy to implement the feature.