{ "info": { "author": "Kristyna Streitova", "author_email": "kstreitova@suse.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: End Users/Desktop", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: System :: Archiving", "Topic :: Utilities" ], "description": "# UnRAR wrapper\n\n[![Build Status](https://travis-ci.org/openSUSE/unrar_wrapper.svg?branch=master)](https://travis-ci.org/openSUSE/unrar#_wrapper)\n\nUnRAR wrapper (`unrar_wrapper.py`) is a wrapper python script that transforms the basic UnRAR commands to unar and lsar calls in order to provide a backwards compatibility.\n\n## Reasons for wrapper\n[UnRAR](https://www.rarlab.com) is freeware command-line application for extracting RAR file archives. Unfortunately, this piece of software is non-free and therefore in many distributions, it's beeing replaced by LGPL [the Unarchiver (unar/lsar)](https://theunarchiver.com/command-line).\n\nIn general, the Unarchiver seems to be a good alternative to non-free unrar. It supports basically the same formats (except for UUE and JAR and a limited support for ARJ (no multi-part) and ACE (no support for Ace 2.0)) and it also supports RAR5. \n\nUnfortunately, UnRAR and Unarchiver are not CLI compatible at all, they have a different set of options. Unrar supports quite a big set of options (sometimes rather obscure and unnecessary) while Unarchiver only supports a relatively small subset of it. Unarchiver also distributes this functionality between `unar` (unpacking) and `lsar` (listing and testing) utilities.\n\n\n## Supported functionality\nAs it was already written, UnRAR provides a huge set of commands and options, while Unarchiver only a relatively small subset of it. As the main purpose of this wrapper is to preserve the basic backwards compatibility, only the essential commands and options are supported.\n\n### Synopsis\n`unrar command [option1] [optionN] archive [files...] [@listfiles...] [path_to_extract/]`\n\n`unar [OPTION]... ARCHIVE [FILE]...`\n\n`lsar [OPTION]... ARCHIVE...`\n\nAs you can see even UnRAR and Unarchiver synopsis is different. Wrapper supports UnRAR synopsis as is only for extract (`x`) command. For list (`l`) and test (`t`) commands it supports neither `files`, `@listfiles` nor `path_to_extract/` as Unarchiver doesn't provide this functionality.\n\n| UnRAR | unar | wrapper implementation |\n|--|--|--|\n| `[files...]` | `[FILE]` | direct | \n| `[@listfiles...]` | not supported | via multiple `[FILE]` | \n| `[path_to_extract/]` | `unar -output-directory` | direct | \n\n\n### Commands\n#### Extract\n| UnRAR cmd | unar cmd | wrapper implementation |\n|--|--|--|\n| `e` | not supported | not implemented |\n| `x` | `unar` | direct | \n\nUnRAR command `e` extracts files without an archived path. Unarchiver doesn\u2019t support this behaviour and therefore it would need to be simulated by this wrapper. Unfortunately, this would be quite a complex feature for example because of the interactivity when files conflicts emerge and therefore it\u2019s not implemented within this wrapper.\n\n#### List \nUnRAR supports many variants for listing the information about the archive. `l[t[a],b]` for listing of a archive `[technical[all],bare]` and `v[t[a],b]` for verbose listing of a archive. Practically it means the following combinations: `l`, `lt`, `lta`, `lb` ( and vice versa for the `v` option). However, `lsar` supports only basic listing and options `l` and `L` for print more/all information about each file in the archive.\n\nAccording to my tests, there is no difference in the output for `l` and `v` command except for plain `unrar l` and `unrar v`, where `unrar v` adds `packed` and `ratio` column to the output. As the purpose of this wrapper is not to precisely simulate the output, the following simplified projection was used:\n\n| UnRAR cmd| lsar cmd | \n|--|--|\n| `lb`, `vb` | `lsar` |\n| `l`, `v` | `lsar -l` |\n| `lt`, `lta`,`vt`, `vta` | `lsar -L` |\n\n#### Test\n| UnRAR cmd | lsar cmd | wrapper implementation\n|--|--|--|\n| `t` | `-t` |direct\n\n#### Print\n| UnRAR cmd | unar cmd | wrapper implementation\n|--|--|--|\n| `p` | not supported | not implemented\n\nUnRAR's `p` command simply prints the file to stdout. It's not supported in unar and as I don't find this command critical, I didn't implement it.\n\n### Options\nUnRAR contains many options but only the following are directly supported in the Unarchiver. Simulation of the other options is beyond the scope of this wrapper.\n\n|UnRAR opt| unar/lsar opt| wrapper implementation\n|--|--|--|\n| `-o+` | `unar-force-overwrite` | direct\n| `-o-` | `unar -force-skip`| direct\n| `-or` | `unar -force-rename`| direct\n| `-p[password]` | `p PASSWORD`| direct\n\nFor UnRAR, all these options can be used with all commands, even if it doesn't make any sense. In that case, it's simply ignored (e.g. when you use `-o+` with `l` command). Based on what is supported in `unar` I decided to support these options only for extract command, with the exception of `-p` that is supported for all commands. \n\n#### Default options\n\nIf the archive has no directory (i.e. files are present directly in the archive) then UnRAR unpack them as is. But unar create a containing directory by default if there is more than one top-level file or folder. Because of this, we need to use `-D, -no-directory` unar option as default. This option means to never create an extra containing directory for the contents of the unpacked archive.\n\n### Return codes\n\nUnRAR supports many return codes that indicate what was wrong (e.g. wrong password, write error, file create error etc.). However, Unarchiver uses only two basic return codes - 0 (success) and 1 (error). As it's impossible to translate return code 1 to any other more specific description of the error, only these two codes are supported by this wrapper with the addition of code 2 that indicates wrapper argument error.\n\n## Tests\n\nThis project contains two types of tests - unit and functional. Unit tests test the basic functionality of the particular python functions. Functional tests perform tests on real RAR archives (located in `tests/testdata` directory).\n\nIf you want to run unit tests then run `python3 -m unittest tests.test_unrar_wrapper` from the main directory.\n\nIf you want to run functional tests then run `./tests/functional_tests.sh tests/testdata/functional/ unrar_wrapper.py` from the main directory.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/openSUSE/unrar_wrapper", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/openSUSE/unrar_wrapper", "keywords": "unar unrar", "license": "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "maintainer": "", "maintainer_email": "", "name": "unrar_wrapper", "package_url": "https://pypi.org/project/unrar_wrapper/", "platform": "Linux", "project_url": "https://pypi.org/project/unrar_wrapper/", "project_urls": { "Download": "https://github.com/openSUSE/unrar_wrapper", "Homepage": "https://github.com/openSUSE/unrar_wrapper" }, "release_url": "https://pypi.org/project/unrar_wrapper/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Backwards compatibility between unar and unrar", "version": "1.0.0" }, "last_serial": 3834757, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "18c57d6046ceb504652645b6b1fe3295", "sha256": "df997a2370913c5f6e49114d0301e77bc3cea8ed6fdca5308468c8753fb43e70" }, "downloads": -1, "filename": "unrar_wrapper-1.0.0.tar.gz", "has_sig": false, "md5_digest": "18c57d6046ceb504652645b6b1fe3295", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55112, "upload_time": "2018-05-04T15:19:25", "url": "https://files.pythonhosted.org/packages/d3/74/3b885007804125b81e5b7ad0c81c3c076d8b96e4e7b74178f4575e2af359/unrar_wrapper-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "18c57d6046ceb504652645b6b1fe3295", "sha256": "df997a2370913c5f6e49114d0301e77bc3cea8ed6fdca5308468c8753fb43e70" }, "downloads": -1, "filename": "unrar_wrapper-1.0.0.tar.gz", "has_sig": false, "md5_digest": "18c57d6046ceb504652645b6b1fe3295", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55112, "upload_time": "2018-05-04T15:19:25", "url": "https://files.pythonhosted.org/packages/d3/74/3b885007804125b81e5b7ad0c81c3c076d8b96e4e7b74178f4575e2af359/unrar_wrapper-1.0.0.tar.gz" } ] }