mitsuhiko

unp: Unpack Archives from the Command Line

unp is a Python command-line wrapper that selects system tools to extract many common archive formats. It can place multi-item archives in a containing folder, helping keep the current working directory tidy.

PythonOther licenseCLIUtilityDeveloper Tools
Stars
455
Forks
55
Stars, last 7 days
+0

Our take

Health score

21/100

How it is scored
Activity
20
Community
21
Issues
21
Pull requests
21

+0 stars in the last 7 days

  • Fewer contributors than 86% of the projects we track

Overview

unp provides one command for extracting a range of archive formats, instead of requiring users to remember which unpacking utility to invoke for each one. It works by wrapping other shell tools available on POSIX systems.

When an archive contains multiple top-level items, unp places the extracted contents in a folder to avoid scattering files through the current working directory. It is aimed at people who regularly handle archives from the command line and want a simpler, tidier extraction workflow.

Key Features

  • Chooses an unpacking command based on the archive type.
  • Supports 7z, AR, DMG, bz2, gzip, tar, RAR, CAB, XZ, and zip-family archives.
  • Handles compressed tarballs as well as standalone compressed files.
  • Wraps multi-item archive contents in a folder to protect the working directory from clutter.
  • Uses hdiutil to extract DMG contents on OS X.
  • Provides a single unp command for supported formats.

Use Cases

  • Developers unpacking downloaded source archives can use one command without selecting an extractor manually.
  • Command-line users handling mixed archive formats can use unp to simplify a repeated extraction workflow.
  • Anyone extracting an archive with several top-level items can avoid filling the current directory with loose files.
  • OS X users working with DMG or sparseimage files can use the tool to copy out their contents.

Getting Started

Install with pipsi and unpack an archive:

pipsi install unp
unp myarchive.tar.gz

See the repository README for details.

Considerations

unp is a wrapper around other shell tools, so extraction depends on the relevant unpacking utilities being available on the system. DMG support is limited to OS X and uses hdiutil. The repository was last pushed in 2017, so check its current compatibility with your environment before relying on it.

Found this useful?

Share it with someone who would like unp.