Package: allz
A universal command line tool for compression and decompressionSupports more normal compressed file formats than I can remember, like Zip, Tar, Gzip, Bzip2, 7-Zip, Rar, Rar.bz2, Tar.gz and so on.Supports split volumn compressed file for certain formats, like Tar.bz2, Tar.bz, Tar.gz, Tgz, Tar.7z, Tar, 7z, Zip, Rar.Supports decompress normal and split volumn compressed file in the same command. In split volumn mode, any part of the input split file can be decompress correctly.Support for automatic creation of target folders. If you have a path with spaces in it, it will handle that too.The decompress engine itself and command-line tool has only been tested in Linux environment so far.Install ClipipinstallallzCommand Descriptionallz-d-q-fsrc_path-odest_pathsrc_path       The input source path.dest_path    The output destination path.-d        Decompress normal or split compressed files.-q        Run in quiet mode.-f        Always overwrite files when a file to be unpacked already exists on disk. By default, the program will skips the file.-p        Output regular expressions for both regular compressed files and slice compressed files successively: the first line is for the normal compressed file, the second line is for the split volumn compressed file.-p --only-normal    Output regular matching expressions for normal compressed files only.-p --only-split       Output regular expressions for split volumn compressed files only.Available options:--output-directory (-o)       The directory to write the contents of the archive to. Defaults to the current directory.ExamplesSuppose we now have a normal compressed file MNIST.7z and two split volumn compressed files MNIST.tar.7z.001, MNIST.tar.7z.002.1. View the versionallz--version2. View the helpallz-horallz--help3. Check which types are supported for decompression in your local environmentallzcheck4. Decompress the normal file MNIST.7z to current directoryallz-dMNIST.7zIn default, if the compressed file have already decompress before, it will skip the same file. You can use option -f to overwrite the files.allz-d-fMNIST.7zYou can also mask screen log output by use option -q.allz-d-qMNIST.7z5. Decompress the normal file MNIST.7z to the specified directory by use option -oallz-dMNIST.7z-o/tmpYou can also use the relative destination path.allz-dMNIST.7z-o..6. Decompress the split volumn file MNIST.tar.7z.001allz-dMNIST.tar.7z.001Decompress the split volumn file to specified directory by use option -o.allz-dMNIST.tar.7z.001-o/tmp7.Handle the path with space in itMethods of using escapesallz-d20220101\todo/MNIST.7z-o/tmp/20220101\done/MNIST.7zMethods of using quotation marksallz-d"20220101 todo/MNIST.7z"-o"/tmp/20220101 done/MNIST.7z"8. Decompress the file into a recurvise destination directoryIt will automatically create folders that do not exist.allz-dMNIST.7z-o/tmp/today/fruit/apple/SDK1. Function get_compressed_files_classify_lstSource code: allz/libs/file_type_testerFileTypeTester.get_compressed_files_classify_lst(file_lst)Return a nested list which will sort the input file list into multiple common or split volumn compressed file lists. The input parameter file_lst is a list of files in the same hierarchical directory. The list can be a file name, a full path or a relative path name. Function only processes compressed files, including normal compressed files and split volumn compressed files, ignoring the processing of normal files.A short usage example:fromallz.libs.file_type_testerimportFileTypeTesterfile_lst=["MNIST.tar.0000","MNIST.tar.0001","MNIST.tar.0002","MNIST.tar.0003","MNIST.tar.0004","MNIST.tar.7z.001","MNIST.tar.7z.002","MNIST.part1.rar","MNIST.part2.rar","MNIST.part3.rar","MNIST.part4.rar","MNIST.7z.001","MNIST.7z.002","123.rar","abc.zip","abc","000","0000.tar","02287.txt"]tester=FileTypeTester()res_lst=tester.get_compressed_files_classify_lst(file_lst)print(res_lst)Output:[['/home/work/srccode/github/allz/allz/libs/MNIST.tar.0000', '/home/work/srccode/github/allz/allz/libs/MNIST.tar.0002', '/home/work/srccode/github/allz/allz/libs/MNIST.tar.0004', '/home/work/srccode/github/allz/allz/libs/MNIST.tar.0003', '/home/work/srccode/github/allz/allz/libs/MNIST.tar.0001'], ['/home/work/srccode/github/allz/allz/libs/MNIST.tar.7z.002', '/home/work/srccode/github/allz/allz/libs/MNIST.tar.7z.001'], ['/home/work/srccode/github/allz/allz/libs/MNIST.part4.rar', '/home/work/srccode/github/allz/allz/libs/MNIST.part1.rar', '/home/work/srccode/github/allz/allz/libs/MNIST.part2.rar', '/home/work/srccode/github/allz/allz/libs/MNIST.part3.rar'], ['/home/work/srccode/github/allz/allz/libs/MNIST.7z.001', '/home/work/srccode/github/allz/allz/libs/MNIST.7z.002'], ['/home/work/srccode/github/allz/allz/libs/123.rar'], ['/home/work/srccode/github/allz/allz/libs/000.tar']]