File: README.md

package info (click to toggle)
python-arpy 1.1.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 156 kB
  • sloc: python: 441; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,117 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Arpy
====

This library can be used to access **ar** files from python. It's tested to work with python 2.6, 2.7, 3.3 and pypy. Travis status: [![Build Status](https://travis-ci.org/viraptor/arpy.png)](https://travis-ci.org/viraptor/arpy)

It supports both GNU and BSD formats and exposes the archived files using the standard python **file** interface.

Usage
=====

Standard file usage:
--------------------

    ar = arpy.Archive('file.ar'))
    ar.read_all_headers()
    
    # check all available files
    ar.archived_files.keys()
    
    # get the contents of the archived file
    ar.archived_files[b'some_file'].read()

Stream / pipe / ... usage:
--------------------------

    ar = arpy.Archive('file.ar'))
    for f in ar:
        print("got file name: %s" % f.header.name)
        print("with contents: %s" % f.read())

Contributions
=============

All contributions welcome. Just make sure that:

*  tests are provided
*  all current platforms are passing (tox configuration is provided)
*  coverage is close to 100% (currently only missing statements are those depending on python version being used)