2012-12-13 20:34:57 +00:00
|
|
|
Patool
|
|
|
|
=======
|
|
|
|
|
2013-03-28 18:41:31 +00:00
|
|
|
Patool is an archive file manager.
|
2013-02-26 19:42:05 +00:00
|
|
|
|
2016-01-09 19:58:15 +00:00
|
|
|
Various archive formats can be created, extracted, tested, listed,
|
|
|
|
searched, repacked and compared with patool. The advantage of patool is
|
|
|
|
its simplicity in handling archive files without having to remember a
|
|
|
|
myriad of programs and options.
|
2012-12-13 20:34:57 +00:00
|
|
|
|
|
|
|
The archive format is determined by the file(1) program and as
|
|
|
|
a fallback by the archive file extension.
|
|
|
|
|
2016-01-09 19:58:15 +00:00
|
|
|
patool supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), ALZIP (.alz),
|
2013-02-27 18:38:07 +00:00
|
|
|
APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2),
|
2013-03-12 06:32:59 +00:00
|
|
|
CAB (.cab), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms),
|
2013-02-27 18:38:07 +00:00
|
|
|
FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh),
|
2016-01-09 19:58:15 +00:00
|
|
|
LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr),
|
|
|
|
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz),
|
|
|
|
ZIP (.zip, .jar, .cbz) and ZOO (.zoo) archive formats.
|
|
|
|
It relies on helper applications to handle those archive formats
|
|
|
|
(for example bzip2 for BZIP2 archives).
|
|
|
|
|
|
|
|
The archive formats TAR, ZIP, BZIP2 and GZIP are supported natively
|
|
|
|
and do not require helper applications to be installed.
|
2012-12-13 20:34:57 +00:00
|
|
|
|
|
|
|
Examples
|
2012-12-13 20:36:58 +00:00
|
|
|
---------
|
2012-12-13 20:34:57 +00:00
|
|
|
```
|
2014-04-07 16:54:20 +00:00
|
|
|
# Extract several archives with different formats
|
2012-12-13 20:34:57 +00:00
|
|
|
patool extract archive.zip otherarchive.rar
|
2014-06-26 17:48:21 +00:00
|
|
|
|
2020-11-04 10:08:37 +00:00
|
|
|
# Extract archive with password
|
|
|
|
patool extract --password somepassword archive.rar
|
|
|
|
|
2014-04-07 16:54:20 +00:00
|
|
|
# Test archive integrity
|
2012-12-13 20:34:57 +00:00
|
|
|
patool test --verbose dist.tar.gz
|
2014-06-26 17:48:21 +00:00
|
|
|
|
2014-04-07 16:54:20 +00:00
|
|
|
# List files stored in an archive
|
2012-12-13 20:34:57 +00:00
|
|
|
patool list package.deb
|
2014-06-26 17:48:21 +00:00
|
|
|
|
2014-04-07 16:54:20 +00:00
|
|
|
# Create a new archive
|
2013-05-06 18:43:02 +00:00
|
|
|
patool create --verbose /path/to/myfiles.zip file1.txt dir/
|
2014-06-26 17:48:21 +00:00
|
|
|
|
2020-11-04 10:08:37 +00:00
|
|
|
# Create a new archive with password
|
|
|
|
patool create --verbose --password somepassword /path/to/myfiles.zip file1.txt dir/
|
|
|
|
|
2014-04-07 16:54:20 +00:00
|
|
|
# Show differences between two archives
|
2012-12-13 20:34:57 +00:00
|
|
|
patool diff release1.0.tar.gz release2.0.zip
|
2014-06-26 17:48:21 +00:00
|
|
|
|
|
|
|
# Search for text inside archives
|
2013-02-23 18:38:23 +00:00
|
|
|
patool search "def urlopen" python-3.3.tar.gz
|
2014-06-26 17:48:21 +00:00
|
|
|
|
2014-04-07 16:54:20 +00:00
|
|
|
# Repackage an archive in a different format
|
2012-12-13 20:34:57 +00:00
|
|
|
patool repack linux-2.6.33.tar.gz linux-2.6.33.tar.bz2
|
|
|
|
```
|
2012-12-14 21:04:48 +00:00
|
|
|
|
|
|
|
Website
|
|
|
|
--------
|
2013-04-09 17:30:31 +00:00
|
|
|
See http://wummel.github.io/patool/ for more info and downloads.
|
2012-12-14 21:04:48 +00:00
|
|
|
|
2013-05-06 18:43:02 +00:00
|
|
|
API
|
|
|
|
----
|
|
|
|
You can use patool functions from other Python applications.
|
|
|
|
Log output will be on sys.stdout and sys.stderr.
|
|
|
|
On errors, `PatoolError` will be raised.
|
2014-01-18 19:26:49 +00:00
|
|
|
Note that extra options such as password input or customization
|
|
|
|
for specific archive programs are not supported.
|
2013-05-06 18:43:02 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
import patoolib
|
|
|
|
patoolib.extract_archive("archive.zip", outdir="/tmp")
|
|
|
|
patoolib.test_archive("dist.tar.gz", verbosity=1)
|
|
|
|
patoolib.list_archive("package.deb")
|
|
|
|
patoolib.create_archive("/path/to/myfiles.zip", ("file1.txt", "dir/"))
|
|
|
|
patoolib.diff_archives("release1.0.tar.gz", "release2.0.zip")
|
|
|
|
patoolib.search_archive("def urlopen", "python3.3.tar.gz")
|
|
|
|
patoolib.repack_archive("linux-2.6.33.tar.gz", "linux-2.6.33.tar.bz2")
|
|
|
|
```
|
|
|
|
|
2013-02-23 15:19:29 +00:00
|
|
|
Test suite status
|
|
|
|
------------------
|
|
|
|
Patool has extensive unit tests to ensure the code quality.
|
|
|
|
[Travis CI](https://travis-ci.org/) is used for continuous build
|
|
|
|
and test integration.
|
|
|
|
|
|
|
|
[![Build Status](https://travis-ci.org/wummel/patool.png)](https://travis-ci.org/wummel/patool)
|