Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 1.34 KB

index.rst

File metadata and controls

60 lines (37 loc) · 1.34 KB

Welcome to seven_zip's documentation!

The seven_zip module handles interaction from python with 7zip, p7zip. It only supports snooping in archives and unpacking.

you'll need the 7zip binary in the path. get theese from here:

- unix: http://p7zip.sourceforge.net/ please consider a donation to Igor Wiktorowitsch Pawlow, paypal@7-zip.org

Get seven_zip from github: https://github.com/jojoo-/seven_zip/ (c) jonas osswald 2013, licensed as lgpl.

Demo!

Create a object like this:

>>> zipfile = seven_zip.SevenZip("file.zip")

then you can do fancy stuff like:

>>> zipfile.getnames()

to print all files in the archive. or extract it:

>>> zipfile.extractall("~/")

or more advanced: extract only jpg's bigger than 1MB to a special folder:

>>> for member in zipfile.searchmember("*.jpg"):
>>>    if member.size > (1024**2):
>>>        member.extract("/tmp/bigpictures")

Contents:

seven_zip_rst faq

Indices and tables

  • genindex
  • modindex
  • search