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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

unrar_cffi-0.2.0a1-cp37-cp37m-win_amd64.whl (183.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

unrar_cffi-0.2.0a1-cp36-cp36m-macosx_10_12_x86_64.whl (153.3 kB view details)

Uploaded CPython 3.6m macOS 10.12+ x86-64

File details

Details for the file unrar_cffi-0.2.0a1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: unrar_cffi-0.2.0a1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 183.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.8

File hashes

Hashes for unrar_cffi-0.2.0a1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 7fb38c6e6eb37274519dabd22d5fde5a3c6edadc83041641dfd3ae687979837f
MD5 c39d68974bb921b8b9e237955434c90c
BLAKE2b-256 13a4afddab85d97b24a9348ef0b02672c63c2941f232c856fef07610d1ff9862

See more details on using hashes here.

File details

Details for the file unrar_cffi-0.2.0a1-cp36-cp36m-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: unrar_cffi-0.2.0a1-cp36-cp36m-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 153.3 kB
  • Tags: CPython 3.6m, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.3

File hashes

Hashes for unrar_cffi-0.2.0a1-cp36-cp36m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 71c64554ced6577280f2c1f400d4bc2c88e9585d5e87d8ceee4a894971208fe8
MD5 e6099be09ef2e0327d30530606959c7b
BLAKE2b-256 09981ae883150426840f044fb3a77a97fffa8d249961d4f0e46a781aa8095fe9

See more details on using hashes here.

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