Coder Social home page Coder Social logo

lib-rar-python's Introduction

This is a fork of lib-rar-python written by miebach, with more options when archiving

This package asissts using the command line version of rar on linux

Install this module:

    sudo pip install librar-0.0.x.tar.gz 

(replace x with your version)

You also need rar, on ubuntu:

    sudo aptitude install rar

Usage example

  #!/usr/bin/python
  from librar import archive
  
  base="/home/me" # all files in archive will be relative to this path
  a = archive.Archive("/tmp/testarchive1.rar",base) # archive will be created in /tmp
  a.add_file("/home/me/testfile") # testfile will be added to archive
  a.set_password("awesomesauce") # set password to the archive
  a.set_compression_level(0) # change compression level to Store
  a.set_recovery_record(5) # set recovery record to 5%
  a.set_volume_size("50k") # split archive based on volume size 50 kilobytes
  
  # create archive:
  a.run() 
  

You can also add directories:

  a.add_dir("/home/me/dir1") # directory and everythin below it will be added to archive
  
You can use add_dir and add_file multiple times and also combine them.

To exclude directories or files:
  
  a.exclude("/home/me/dir1/tmp") # directory and everythin below it (?) will be excluded
  

lib-rar-python's People

Contributors

dangmai avatar kwmiebach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lib-rar-python's Issues

Error when running on windows

I am running this code on Windows, I keep getting this error:
AttributeError: 'Archive' object has no attribute 'set_compression_level'

So, other than changing the path, are there any changes that need to be done for the code to work?

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.