Skip to main content

Access ar archive files (.a)!

Project description

build

python-3.11 python-3.10 python-3.9 python-3.8 python-3.7

ar

Python package for parsing ar archive file.

Installation

pip install ar

Usage

List files inside file.a

from ar import Archive
with open('file.a', 'rb') as f:
  archive = Archive(f)
  for entry in archive:
    print(entry.name)

Read content of file.txt contained within file.a.

from ar import Archive
with open('file.a', 'rb') as f:
  archive = Archive(f)
  print(archive.open('file.txt').read())

Extract all files:

from ar import Archive
with open('file.a', 'rb') as f:
  archive = Archive(f)
  for entry in archive:
    with open(entry.name) as output:
      content = entry.get_stream().read()
      output.write(content)

Developing

Create a virtual environment using python version of liking

python3.10 -m venv venv

Activate it

source venv/bin/activate

Install package editable together with relevant optional dependencies

pip install -e '.[test,dev]'

Author

Samuel Carlsson

Project details


Download files

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

Source Distribution

ar-0.8.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

ar-0.8-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file ar-0.8.tar.gz.

File metadata

  • Download URL: ar-0.8.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ar-0.8.tar.gz
Algorithm Hash digest
SHA256 5871651a9ef25988f559720bf72e3546b154f85c695997066cef9e0b162bfe83
MD5 038efd80813daf7c445692b59a4908a3
BLAKE2b-256 bf3b22a244da0f2f1496515f7dc0f48819260f0c7d7f31619baf15071c3baa6f

See more details on using hashes here.

File details

Details for the file ar-0.8-py3-none-any.whl.

File metadata

  • Download URL: ar-0.8-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ar-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6ef917e875baef27cb931ad310c4087a204d31b23ee78d0a3707c7a160bd24b6
MD5 057c353c2ff2b4e718bc01cc3d3bb72f
BLAKE2b-256 d5bd5a13d802fc7f7dc575898fdf46aff02c72bc8b99c713fcd8aa11493cd38f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page