This is a command line based Python tool that help you extract the following;
- Extract existing TAR.GZ files to your specified folder path.
- Downloading a TAR.GZ from a URL & extract it to your specified folder path.
- Extract existing ZIP files to your specified folder path.
- Download a ZIP file from a URL & extract it to your specified folder path.
This script requires Python 3
Originally unable to extract TAR.GZ files normally on a server. And wanted a friendly work around to make life easier & in hopes that this helps someone else with the same or a familar problem.
-
Download extractor.py
-
Run script using Python 3. (python extractor.py)
-
You will be prompted with five options
-
- Extract Existing Tar.GZ File
-
- Download & Extract Tar.GZ File
-
- Extract Existing ZIP file
-
- Download & Extract ZIP file
-
- Exit the program
Provide the tar.gz file path to extract tar.gz like the examples below
(/home/username/example/test/geoPHP.tar.gz) < if on Linux
(C:\Users\ExampleUser\Folder\AreYouStillReadingThis\geoPHP.tar.gz) < if on Windows
Provide a Download URL for the TAR.GZ file. Insert direct link to file like example below. (https://phayes.github.io/bin/current/geoPHP/geoPHP.tar.gz)
Provide the folder path you would like to extract the tar.gz file to as shown in the examples below
(/home/username/extract-folder) < if on Linux
(C:\Users\ExampleUser\Folder\AreYouStillReadingThis) < if on Windows
Provide the .zip file path to extract .zip like the examples below
(/home/username/example/test/Extractor.zip) < if on Linux
(C:\Users\ExampleUser\Folder\AreYouStillReadingThis\Extractor.zip) < if on Windows
Provide a Download URL for the .zip file. Insert direct link to file like example below. (https://github.com/MarketingPipeline/Extractor/archive/refs/heads/main.zip)
Provide the folder path you would like to extract the .zip file to as shown in the examples below
(/home/username/extract-folder) < if on Linux
(C:\Users\ExampleUser\Folder\AreYouStillReadingThis) < if on Windows
In your .profile etc. add the script to your path to use it whenever you need it!
alias extractor='python /home/username/extractor.py'
"extractor" is the name you want to use to call the script directly.
"python" is whatever command you use to call Python3.
"/home/username/extractor.py" is the path to the extractor script