Coder Social home page Coder Social logo

henghu-bai / python-unrar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matiasb/python-unrar

0.0 2.0 0.0 353 KB

A ctypes wrapper for UnRAR library, plus a rarfile module on top of it.

Home Page: http://python-unrar.readthedocs.org/en/latest/

License: GNU General Public License v3.0

python-unrar's Introduction

python-unrar

Work with RAR archive files through unrar library using ctypes.

Build Status

Install UnRAR library

python-unrar requires UnRAR library. You can download UnRAR library sources from:

http://www.rarlab.com/rar_add.htm

and compile (you may need to rename the makefile that you want to use according to your OS) and install it from there:

$ make lib
$ make install-lib

(current sources: http://www.rarlab.com/rar/unrarsrc-5.0.7.tar.gz)

For Windows you can also download the already compiled library (http://www.rarlab.com/rar/UnRARDLL.exe).

If you prefer not to install the library, you should make it "findable" by adding the library file to a directory where libraries are searched (or change required environment variable).

As an alternative, you can also set UNRAR_LIB_PATH variable in your environment to the library path and python-unrar will try to load the UnRAR library from there.

Install python-unrar

To install python-unrar:

$ pip install unrar

Examples

>>> from unrar import rarfile
>>> rar = rarfile.RarFile('sample.rar')
>>> rar.namelist()
[u'test_file.txt']
>>> rar.printdir()
File Name                                             Modified             Size
test_file.txt                                  2013-04-14 08:20:28           17
>>> rar.testrar()
>>> info = rar.infolist()[0]
>>> info.filename
u'test_file.txt'
>>> info.file_size
17L
>>> info.date_time
(2013L, 4L, 14L, 8L, 20L, 28L)
>>> rar.extractall()

Docs

Check full documentation in http://python-unrar.readthedocs.org.

python-unrar's People

Contributors

matiasb avatar

Watchers

James Cloos avatar Jumba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.