Skip to main content

zipexec is a pure python alternative to zipgrep

zipexec allows you to specify any command line utiliity you would like to run against a group of .zip files. While zcat, zgrep and other utilities work well on gzip compressed files, I needed similar functionality on pkzip compressed files (with .zip extensions) and was unable to find a tool I liked.

Execute command line utilities of your choice against the contents of zip files.

Help

$ zipexec -h
usage: zipexec [-h] [-c CMD_TO_RUN] path_to_zips

positional arguments:
  path_to_zips          Where are the zips to search

optional arguments:
  -h, --help            show this help message and exit
  -c CMD_TO_RUN, --cmd_to_run CMD_TO_RUN
                        Command line to run on each zip

NOTE: Take care when specifying the names of files and commands that your local linux system does not expand the asterisks.

Example Usage

If you only pass a path to a folder containing zip files to zip exec it will prompt you for a command

$ zipexec /home/uploads/zipfiles/
What command would you like to run?: grep -R -C2 -n "search string" *

If you do specify a command with -c or --command it will execute that

Example 1: grep through the content of all the zip files:

$ zipexec -c 'grep -R -n -C2 "import os" *.py' /home/uploads/zipfiles/  

Example 2: Do a directory listing of all of the zip files that are named file*.zip

$ zipexec -c 'ls -laR' /home/uploads/zipfiles/files\*.zip   

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zipexec-1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zipexec-1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file zipexec-1.0.tar.gz.

File metadata

  • Download URL: zipexec-1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

File hashes

Hashes for zipexec-1.0.tar.gz
Algorithm Hash digest
SHA256 ba80ada8d5f89038a6b1451066d8d2166717305cb89296a9b86c11d13d8b4c8a
MD5 ff42596eeaeb6e442b7b043c69c5c907
BLAKE2b-256 d41a3f925409c1f32d42d618d2bf4f0de7a83ee9af58a996fb80cac9704c95c7

See more details on using hashes here.

File details

Details for the file zipexec-1.0-py3-none-any.whl.

File metadata

  • Download URL: zipexec-1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

File hashes

Hashes for zipexec-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc25c82a8c7863e89bdfcf4de3138fce1cc72c9b6daa86c391508cdea628a704
MD5 c9017c607a35e1526768cdb571294821
BLAKE2b-256 0acd2956ae801623e3ff02ea5e8d745707ce2a9b7aa01d8de1ccb90f890dba50

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page