https://github.com/kovidgoyal/unrardll
Python wrapper for the UnRAR DLL
https://github.com/kovidgoyal/unrardll
Last synced: 10 months ago
JSON representation
Python wrapper for the UnRAR DLL
- Host: GitHub
- URL: https://github.com/kovidgoyal/unrardll
- Owner: kovidgoyal
- License: bsd-3-clause
- Created: 2017-06-15T19:18:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-03T03:15:10.000Z (almost 2 years ago)
- Last Synced: 2024-10-19T22:52:25.077Z (about 1 year ago)
- Language: Python
- Size: 10.2 MB
- Stars: 11
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
unrardll
==========
|pypi| |build|
Python wrapper for the `UNRAR DLL `_.
Usage
-------
.. code-block:: python
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.
.. code-block:: bash
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 :file:`.github/workflows/ci.py` file for a script to install the unrar
dll from source, if needed. This is used on the continuous integration servers.
.. |pypi| image:: https://img.shields.io/pypi/v/unrardll.svg?label=version
:target: https://pypi.python.org/pypi/unrardll
:alt: Latest version released on PyPi
.. |build| image:: https://github.com/kovidgoyal/unrardll/workflows/CI/badge.svg
:target: https://github.com/kovidgoyal/unrardll/actions?query=workflow%3ACI"
:alt: Build status of the master branch