$ unp_ unp is a command line tool that can unpack archives easily. It mainly acts as a wrapper around other shell tools that you can find on various POSIX systems. It figures out how to invoke an unpacker to achieve the desired result. In addition to that it will safely unpack files when an archive contains more than one top level item. In those cases it will wrap the resulting file in a folder so that your working directory does not get messed up. All you have to do: $ unp myarchive.tar.gz To install you can use pipsi: $ pipsi install unp Supports the following archives: - 7zip Archives (*.7z) - AR Archives (*.a) - Apple Disk Image (*.dmg; *.sparseimage) - Bz2 Compressed Files (*.bz2) - Bz2 Compressed Tarballs (*.tar.bz2) - Gzip Compressed Files (*.gz) - Gzip Compressed Tarballs (*.tar.gz; *.tgz) - Uncompressed Tarballs (*.tar) - WinRAR Archives (*.rar) - Windows Cabinet Archive (*.cab) - XZ Compressed Files (*.xz) - XZ Compressed Tarballs (*.tar.xz) - Zip Archives (*.zip; *.egg; *.whl; *.jar) DMG is only supported on OS X where it invokes the hdiutil and copies out the contents.
Unpacks things.
$ unp_ unp is a command line tool that can unpack archives easily. It mainly acts as a wrapper around other shell tools that you can find on various POSIX systems. It figures out how to invoke an unpacker to achieve the desiredCategory: Python / Specific Formats Processing |
Watchers: 18 |
Star: 403 |
Fork: 58 |
Last update: Jul 3, 2022 |
@mitsuhiko is this tool still maintained?
It is a great usability benefit for command-line users, so it would be sad to see it die slowly. I am mainly wondering, as I was thinking about packaging it for NixOS.
typo ?
Missed out on the description
string in setup.py
Hello. Trying to use unp on my old Nokia n810. unp from debian stretch repository.
`[3|[email protected]/]perl -v This is perl, v5.8.3 built for arm-linux-gnueabi-thread-multi
Copyright 1987-2003, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using man perl' or
perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
[3|[email protected]/]unp Can't locate File/Basename.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.3 /usr/local/share/perl/5.8.3 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/bin/unp line 28. BEGIN failed--compilation aborted at /usr/bin/unp line 28. ` How to fix? Thanks.
When extracting multiple similar archives with only one top-level element, user usually wants to have them in a destination directory named after archive's name.
Currently the first archive is extracted to a directory named after the single top-level element while other archives are extracted to directories named after archive's basename.
The --force-basename
option is forcing the latter behaviour for every
archive.
For example, let's say we have two archives, with only one top-level
directory in them (called var
):
$ ls BundleLogs*zip
BundleLogs-1495008842230.zip BundleLogs-1495008843374.zip
When trying to unpack them at once:
$ unp --output /tmp/logs BundleLogs*zip
The default behaviour leaves us with:
$ ls /tmp/logs
BundleLogs-1495008843374 var
Using --force-basename
option:
$ unp --force-basename --output /tmp/logs_basename BundleLogs*zip
We get the following result:
$ ls /tmp/logs_basename
BundleLogs-1495008842230 BundleLogs-1495008843374
I am reading your codes and i an confused about the modules click
I use pip search click and import click
, but the python tell me
ModuleNotFoundError: No module named 'click'
Is there a flag to tell unp to overwrite. Example, if we are uncomrpessing abc.zip(unp abc) it will result in a folder abc under current working directory. If we execute same command again, it will uncompress to abc1 or something like that, without overwriting abc. Is there a flag to force overwrite ?
unp
aims to be a smart program. Could it skip __MACOSX crap while unpacking zips by default? That would be a great feature.