Skip to main content

Read RAR file from python -- cffi edition

Project description

Build Status

unrar-cffi -- Work with RAR files.

Description

unrar-cffi is a python extension that exposes unrar library functionality through a zipfile-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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unrar-cffi-0.2.2.tar.gz (244.1 kB view hashes)

Uploaded Source

Built Distributions

unrar_cffi-0.2.2-cp39-cp39-win_amd64.whl (183.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

unrar_cffi-0.2.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (196.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

unrar_cffi-0.2.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (189.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

unrar_cffi-0.2.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (194.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

unrar_cffi-0.2.2-cp38-cp38-win_amd64.whl (183.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

unrar_cffi-0.2.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (196.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

unrar_cffi-0.2.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (189.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

unrar_cffi-0.2.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (194.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

unrar_cffi-0.2.2-cp37-cp37m-win_amd64.whl (183.8 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

unrar_cffi-0.2.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (195.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

unrar_cffi-0.2.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (189.2 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

unrar_cffi-0.2.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl (194.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ i686

unrar_cffi-0.2.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (195.8 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

unrar_cffi-0.2.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (189.2 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

unrar_cffi-0.2.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl (194.0 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.5+ i686

unrar_cffi-0.2.2-cp36-cp36m-macosx_10_12_x86_64.whl (153.3 kB view hashes)

Uploaded CPython 3.6m macOS 10.12+ x86-64

unrar_cffi-0.2.2-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (189.2 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.5+ x86-64

unrar_cffi-0.2.2-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl (194.0 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.5+ i686

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page