[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

7z archive reader akin to zipfile?

On 2018-01-03 12:10:22 -0600, Skip Montanaro wrote:
> The zipfile module is kind of cool because you can access elements of
> the archive without explicitly uncompressing the entire archive and
> writing the structure to disk. I've got some 7z archives I'd like to
> treat the same way (read specific elements without first extractingg
> the entire tree to disk). I see the pylzma module for compressing and
> uncompressing files, but nothing slightly higher level. Does something
> like that exist?

Have you looked at libarchive (https://pypi.python.org/pypi/libarchive)?
I think it does what you want and it transparently supports several
archive types (including zip and 7z).


   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp at hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20180106/85a6b3fe/attachment.sig>