coverband / unrardll

Python wrapper for the UnRAR DLL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unrardll

Latest version released on PyPi Build status of the master branch on Unix Build status of the master branch on Windows

Python wrapper for the UNRAR DLL.

Usage

from unrardll import extract
extract(archive_path, destination_directory)  # extract everything

from unrardll import names
print(list(names(archive_path)))  # get list of filenames in archive

from unrardll import headers
from pprint import pprint
pprint(list(headers(archive_path)))  # get list of file headers in archive

from unrardll import extract_member
# Extract a single file using a predicate function to select the file
filename, data = extract_member(archive_path, lambda h: h['filename'] == 'myfile.txt')

from unrardll import comment
print(comment(archive_path))  # get the comment from the archive

Installation

Assuming that the RAR dll is installed and the RAR headers available in the include path.

pip install unrardll

You can set the environment variables UNRAR_INCLUDE and UNRAR_LIBDIRS to point to the location of the unrar headers and library file.

See the ci.py file for a script to install the unrar dll from source, if needed. This is used on the continuous integration servers.

About

Python wrapper for the UnRAR DLL

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 60.5%Language:C++ 39.3%Language:Vim Script 0.2%