Skip to content

martinarroyo/lib-rar-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  

About

Create and access rar archives.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Shell 0.2%