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, 'wb') as output:
      content = archive.open(entry, 'rb').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-1.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

ar-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ar-1.0.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for ar-1.0.0.tar.gz
Algorithm Hash digest
SHA256 15be072f33c7ec3fccadbfeced14cc120edc3a5d815fc742a90c12e29d1848db
MD5 52b67b13c04d59b1200ab119d304fc3b
BLAKE2b-256 6c681cf29d90cc65a4964143db2c2d2849959faee398b427a88f376487884d90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ar-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for ar-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d51ef2616433ab399231100b2e40a14a26987d57ed0c6ecf975b7ab8d3f69cf
MD5 7668f49bfff050d547875c3e01a8ae60
BLAKE2b-256 13049ef101e19e669dd96326c4d39a3a4e74902a2b0122a93761d966de4e66a7

See more details on using hashes here.

Supported by

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