Skip to content

A command line based tool for downloading & extracting ZIP and TAR.GZ files. Or simply just extract them!

License

Notifications You must be signed in to change notification settings

MarketingPipeline/Extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Extractor

What does Extractor do

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

Table Of Contents

Why was this made

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.

How to use

  1. Download extractor.py

  2. Run script using Python 3. (python extractor.py)

  3. You will be prompted with five options

    1. Extract Existing Tar.GZ File
    1. Download & Extract Tar.GZ File
    1. Extract Existing ZIP file
    1. Download & Extract ZIP file
    1. Exit the program

Extract Existing Tar.GZ File

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

Download and Extract Tar.GZ File

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

Extract Existing ZIP File

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

Download and Extract ZIP File

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

Add the path to the script on your server

In your .profile etc. add the script to your path to use it whenever you need it!

Example

 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