zipspy - a CLI tool to extract files from zip archives in S3 without needing to download the entire archive

Zipspy

zipspy is a CLI tool to extract files from zip archives in S3 without needing to download the entire archive

Preamble

The zipspy CLI allows you to download specific files and directories from a zip archive in S3 without having to download the entire object.

Installation

To install zipspy, run the following command:

go get github.com/alec-rabold/zipspy

Check that it's installed correctly by running:

zipspy version

Sample Flow

Be sure to set your AWS environment variables before using zipspy:

export AWS_PROFILE={profile}
export AWS_DEFAULT_REGION={region}

The following is an example of how to use the CLI, downloading a file called plan.txt from an S3 zip archive called archive.zip in a bucket named zipspy-test. By default, the result is printed to stdout.

zipspy extract -b zipspy-test -k archive.zip -f plan.txt

You can specify multiple files and/or files paths. Zipspy will download all files whose filepaths contain the given input string. For example:

With an archive.zip that has the following structure:

archive/
├── plan.txt
├── foldername1/
    ├── plan.txt
    └── technology.md
├── foldername2/
    ├── plan.txt
    └── header.html

zipspy extract -b zipspy-test -k archive.zip -f foldername2 -f plan.txt will download the following files:

archive/plan.txt
archive/foldername1/plan.txt
archive/foldername2/plan.txt
archive/foldername2/header.html

zipspy extract -b zipspy-test -k archive.zip -f foldername2/plan.txt will only download:

archive/foldername2/plan.txt

You may also specify output paths to write the file content to. By default, downloaded data will be appended to the specified file(s). If they don't exist, zipspy will create them.

The following example demonstrates how to download a file named plan.txt and save it to data/my-plan.txt.

zipspy extract -b zipspy-test -k archive.zip -f plan.txt -o data/my-plan.txt

You may specify any number of output files as long as there is an equal number of files to download.

zipspy extract -b zipspy-test -k archive.zip -f plan.txt -o data/my-plan.txt -f file.md -o data/file.md
Similar Resources

tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

Feb 6, 2022

Related is a simple cli utility tool to create files or a group of files.

Related - Create files based on individual definitions or groups Related helps with common file-creation-based tasks. You can predefine single types a

Apr 16, 2022

tmux-wormhole - download files and directories with tmux!

tmux-wormhole - download files and directories with tmux!

tmux-wormhole Use tmux and magic wormhole to get things from your remote computer to your tmux. If tmux has DISPLAY set, open the file locally! Demo U

Nov 9, 2022

Downloader written in golang to download the public data files from RUC Paraguay.

rucpy-downloader Downloader written in golang to download the public data files(RUC Paraguay) from set.gov.py. The downloader will download the public

Dec 6, 2021

📥 Command-line tool to download videos from hanime.tv

hanime Command-line tool to download videos from hanime.tv Requirements Installation Install via go get Install from source Install from release Usage

Dec 18, 2022

Snippet CLI manger for quickly using code snippets without leaving the terminal

Snippet CLI manger for quickly using code snippets without leaving the terminal

SnipKit - Snippet CLI manager This repository is still work in progress! SnipKit aims to paste code snippets from your favorite snippet manager into y

Dec 27, 2022

Nebula Diagnosis CLI Tool is an information diagnosis cli tool for the nebula service and the node to which the service belongs.

Nebula Diagnosis CLI Tool is an information diagnosis cli tool for the nebula service and the node to which the service belongs.

Jan 12, 2022

✏️ CLI tool to split a file into smaller sub-files

filesplit CLI tool to split a file into smaller sub-files Build $ go build Usage filesplit [mode] [-F, --file] [-N, --number] Examples # Split foo.txt

Apr 20, 2022

A tool to manage all your boilerplate from cli and generate files for you !

A tool to manage all your boilerplate from cli and generate files for you !

Jul 20, 2022
Comments
  • add local provider; general tidying

    add local provider; general tidying

    • General clean up and simplifying
    • Add plugin architecture for zip reader providers:
      • AWS S3
      • Local File
    • Import latest from archive/zip (some basic logic is changed to support concatenated zip files)
    • Update the commands to be more general and hierarchical
    • Add Makefile
Related tags
ets2-dlc-repacker is a Windows / Linux / MacOS CLI util to automatically repack older DLC archives for compatibility with newer versions.
ets2-dlc-repacker is a Windows / Linux / MacOS CLI util to automatically repack older DLC archives for compatibility with newer versions.

ets2-dlc-repacker is a Windows / Linux / MacOS CLI util to automatically repack older DLC archives for compatibility with newer versions.

Dec 26, 2021
Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files.

ftctl This is a file downloader cli written in Golang which uses the concurrent feature of go to download files. The cli is built using cobra. How to

Jan 2, 2022
Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!

Got. Simple and fast concurrent downloader. Installation ❘ CLI Usage ❘ Module Usage ❘ License Comparison Comparison in cloud server: [root@centos-nyc-

Dec 29, 2022
A command-line to create a pull request to review the entire content of a Github repository.

Pull Request Me Pull Request Me (PRMe) creates a pull request for the entire content of a Github repository. This is useful to solicit review comments

Nov 2, 2021
Tool to extract log files off of the roboRIO automatically

extractor Tool to extract log files off of the roboRIO automatically Steps This program does the following steps once ran: Read from TOML config file

May 15, 2022
This is the tool to download files from qiniu cruster manually.

This is the tool to download files from qiniu cruster manually. toCheck = []string{ sealPath, filepath.Join(cachePath, "p_aux"), filepath.Join(cachePa

Nov 25, 2021
A golang CLI tool to download malware from a variety of sources.

mlget _____ _____ _____ _____ _____ /\ \

Jan 2, 2023
CLI tool to upload object to s3-compatible storage backend and set download policy for it.
CLI tool to upload object to s3-compatible storage backend and set download policy for it.

typora-s3 CLI tool to upload object to s3-compatible storage backend and set download policy for it. Build $ git clone https://github.com/fengxsong/ty

Dec 29, 2021
A CLI application to extract the top customers, and their favourite snacks.

zimpler.candystore An assignment which written as a CLI application in Golang for Zimpler interview process. Getting Started This repository includes

Dec 24, 2021