Skip to main content

Arpy

This library can be used to access ar files from python.

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

Usage

Standard file usage:

With context managers:

with arpy.Archive('file.ar') as ar:
    print("files: %s" % ar.namelist())
    with ar.open('content.txt') as f:
        print(f.read())

Via headers for duplicate names:

with arpy.Archive('file.ar') as ar:
    for header in ar.infolist():
        print("file: %s" % header.name)
        with ar.open(header) as f:
            print(f.read())

Or directly:

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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arpy-2.4.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arpy-2.4.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file arpy-2.4.0.tar.gz.

File metadata

  • Download URL: arpy-2.4.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arpy-2.4.0.tar.gz
Algorithm Hash digest
SHA256 e2ce13869a2df98b420adeaf7429b63796e8c000969d2dfe471854c0be3d9a54
MD5 eaebbf56161a044eafb697c0b8352b22
BLAKE2b-256 409d1febb3091ab01710abb1628194f3c0f5d97f7e5c97f3fbcdaf55e30bdd4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for arpy-2.4.0.tar.gz:

Publisher: CI.yml on onekey-sec/arpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arpy-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: arpy-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arpy-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c341410d0df54af903fcd18e4b82e7cfe2b5ed10a186cf6cb53e664e70449ba2
MD5 e97900087851adfc4c51df5cc4b8684d
BLAKE2b-256 60560ed5dc83e59537e0ee3726b008ed06736577169ba5cfaed989356abb5609

See more details on using hashes here.

Provenance

The following attestation bundles were made for arpy-2.4.0-py3-none-any.whl:

Publisher: CI.yml on onekey-sec/arpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 files

2.3.0

1 file

2.2.0

1 file

2.1.0

1 file

2.0.1

1 file

2.0.0

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.0

1 file

0.2.0

1 file

0.1.1

2 files

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page