Metadata-Version: 2.4
Name: unrar-cffi
Version: 0.2.2
Summary: Read RAR file from python -- cffi edition
Home-page: https://github.com/davide-romanini/unrar-cffi
Author: Davide Romanini
Author-email: davide.romanini@gmail.com
License: apache-2.0
Keywords: rar,unrar,archive,cffi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3.4
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cffi
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

[![Build Status](https://travis-ci.org/davide-romanini/unrar-cffi.svg?branch=develop)](https://travis-ci.org/davide-romanini/unrar-cffi)

# unrar-cffi -- Work with RAR files.

## Description

unrar-cffi is a python extension that exposes [unrar library](https://rarlab.com/rar_add.htm)
functionality through a [`zipfile`](https://docs.python.org/3/library/zipfile.html)-like interface.

## Features

The package implements the following `RarFile` functions:

 * `namelist()`
 * `infolist()`
 * `getinfo()`
 * `read()`
 * `open()`
 * `testrar()`
 * `rarfile.is_rar_file()`

## Usage

 1. Install with PIP:

    `pip install unrar-cffi`

 2. Use from code:

```python
    from unrar.cffi import rarfile

    rar = rarfile.RarFile('sample.rar')

    assert rar.testrar() == None

    for filename in rar.namelist():
        info = rar.getinfo(filename)
        print("Reading {}, {}, {} bytes ({} bytes compressed)".format(info.filename, info.date_time, info.file_size, info.compress_size))
        data = rar.read(filename)
        print("\t{}...\n".format(data[:100]))
```

## Build

### Requirements

Linux:
 * gcc compiler suite (`build-essential` packages should be enough)
 * docker (only for `buildmanylinux`)

Windows:
 * VS2017 Build Tools (PLATFORM_TOOLSET=v141)
 * Visual C++ compiler suite

### Compile and test

 1. `./build.sh init`
 2. `./build.sh build`
 3. `./build.sh test`

If you have docker installed, you can build all the [manylinux](https://github.com/pypa/manylinux) 
wheels:

 1. `./build.sh within [manylinux docker image] buildmanylinux`
 2. `./build.sh within [manylinux docker image] testmanylinux`

By deafult the image `quay.io/pypa/manylinux2010_x86_64` will be used.
Use `$DOCKER_IMAGE` and `$PLAT` variables to customize the build.
