Skip to main content

A universal command line tool for compression and decompression

  • Supports 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 Cli

pip install allz

Command Description

allz -d -q -f src_path -o dest_path
  • src_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.

Examples

Suppose 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 version

allz --version

2. View the help

allz -h

or

allz --help

3. Check which types are supported for decompression in your local environment

allz check

4. Decompress the normal file MNIST.7z to current directory

allz -d MNIST.7z

In 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 -f MNIST.7z

You can also mask screen log output by use option -q.

allz -d -q MNIST.7z

5. Decompress the normal file MNIST.7z to the specified directory by use option -o

allz -d MNIST.7z -o /tmp

You can also use the relative destination path.

allz -d MNIST.7z -o ..

6. Decompress the split volumn file MNIST.tar.7z.001

allz -d MNIST.tar.7z.001 

Decompress the split volumn file to specified directory by use option -o.

allz -d MNIST.tar.7z.001 -o /tmp

7.Handle the path with space in it

Methods of using escapes

allz -d 20220101\ todo/MNIST.7z -o /tmp/20220101\ done/MNIST.7z

Methods of using quotation marks

allz -d "20220101 todo/MNIST.7z" -o "/tmp/20220101 done/MNIST.7z"

8. Decompress the file into a recurvise destination directory

It will automatically create folders that do not exist.

allz -d MNIST.7z -o /tmp/today/fruit/apple/

SDK

1. Function get_compressed_files_classify_lst

  • Source code: allz/libs/file_type_tester

  • FileTypeTester.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:

      from allz.libs.file_type_tester import FileTypeTester
    
      file_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']]

Release files for allz 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for allz 0.1.4
File Size Uploaded
allz-0.1.4.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for allz 0.1.4
File Interpreter ABI Platform
allz-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 33.2 kB

Release files / allz-0.1.4.tar.gz

Download URL allz-0.1.4.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
469b176689324e0022737d5db1f5657ec8b6b5aff5d9c2461ee5452101151ef3
BLAKE2b-256 checksum
How to use checksums
3fba7b0ec1168d1227570914f328066e4d9bbdafc9b569819818c5b8e59b658f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.13

Release files / allz-0.1.4-py3-none-any.whl

Download URL allz-0.1.4-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba0f2625218b4968ed0254ffb0e219d8e8ae2774d78510595a59a2e45adc92ad
BLAKE2b-256 checksum
How to use checksums
6542b4a3a1a7f46547a2f2042e6faa43f610c0a90eab8d3679e48b176174a7a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.13

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

1 release file

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page