noaione / unrar2-cffi

Python unrar cffi edition - forked edition
Apache License 2.0
0 stars 0 forks source link

Build

unrar2-cffi -- Work with RAR files.

Description

unrar2-cffi is a python extension that exposes unrar library functionality through a zipfile-like interface.

This is a fork/modified version of unrar-cffi that supports modern Python starting from 3.9+

This build also target unrar 6.x instead of unrar 5.x from the original unrar-cffi project.

Difference

This packages has some difference to the original one:

Features

The package implements the following RarFile functions:

Usage

  1. Install with PIP:

    pip install unrar2-cffi

  2. Use from code:

    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/macOS:

Windows:

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 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.

Problems

Windows:

macOS: