(zip_fname: str, out_dir: str)
Extract `zip_fname` into output directory `out_dir`

    Parameters
    ----------
    zip_fname : str
        Filename of zip archive to write
    out_dir : str
        Directory path containing files to go in the zip archive
Extract `zip_fname` into output directory `out_dir`
Extract zip_fname into output directory out_dir
def zip2dir(zip_fname: str, out_dir: str) -> None:
    """Extract `zip_fname` into output directory `out_dir`

    Parameters
    ----------
    zip_fname : str
        Filename of zip archive to write
    out_dir : str
        Directory path containing files to go in the zip archive
    """
    with zipfile.ZipFile(zip_fname, "r") as z:
        for name in z.namelist():
            member = z.getinfo(name)
            extracted_path = z.extract(member, out_dir)
            attr = member.external_attr >> 16
            if member.is_dir():
                # this is always rebuilt as 755 by dir2zip
                os.chmod(extracted_path, 0o755)
            elif attr != 0:
                attr &= 511  # only keep permission bits
                attr |= 6 << 6  # at least read/write for current user
                os.chmod(extracted_path, attr)
def zip2dir ( zip_fname : str , out_dir : str ) -> None : with zipfile . ZipFile ( zip_fname , "r" ) as z : for name in z . namelist ( ) : member = z . getinfo ( name ) extracted_path = z . extract ( member , out_dir ) attr = member . external_attr >> 16 if member . is_dir ( ) : # this is always rebuilt as 755 by dir2zip os . chmod ( extracted_path , 0o755 ) elif attr != 0 : attr &= 511 # only keep permission bits attr |= 6 << 6 # at least read/write for current user os . chmod ( extracted_path , attr )