skillfed

ar

Access ar archive files (.a)!

ar v1.0.1 109.5K downloads/30d#12,513 on PyPI13
Permissive license Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) AGING released

What it is and what it does

ar is a pure-Python parser for Unix ar archive files (.a), commonly used in build systems and static libraries. It provides a simple interface to iterate over archive entries, read individual file contents, and extract files to disk without requiring external tools or compiled dependencies.

The package exposes an Archive class that wraps a binary file handle and supports iteration over entries, opening and reading specific files by name, and extracting all contents. It supports Python 3.8 through 3.11 and has no external runtime dependencies, making it lightweight for build automation, static library inspection, or archive manipulation in pure Python environments.

Use it for:

  • Extract object files or metadata from static libraries (.a) in build pipelines.
  • Inspect the contents of ar archives without invoking system tools like ar or tar.
  • Read embedded files from ar archives in cross-platform Python applications.
  • Automate library analysis or dependency inspection in CI/CD workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses and reads ar archive files (.a), allowing you to list, extract, and read individual files from Unix ar archives without external dependencies.

Yes, if you need to parse ar archives in Python without system dependencies. The package is straightforward, has no external runtime dependencies, and covers a narrow but real use case. Maintenance is aging but not abandoned; the code is stable and suitable for build automation or library inspection tasks where ar format support is needed.

Install

ar on PyPI

pip

pip install ar

uv

uv add ar

poetry

poetry add ar

Installing ar

Before you install

Low friction installation with no runtime dependencies. Maintenance status is aging—last commit was 2025-12-18, but the repository is not archived and the package remains functional.

License in practice

Licensed under Apache License Version 2.0, a permissive license that allows commercial and derivative use with minimal restrictions, requiring only attribution and notice of modifications.

Quickstart

pip install ar

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

Requires Python 3.8 or later; ar archives must be opened in binary mode.

Verify before relying

  • Whether the package handles all ar archive variants (GNU, BSD, etc.) or has known format limitations.
  • Performance characteristics when working with large archives or many files.

Package facts

License Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 310 days since the last release
Last repo commit
First released
Downloads 109,543/month — #12,513 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ar-1.0.1-py3-none-any.whl

Keywords: ar, archive, extract, library

Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

ar archive parserread .a files pythonextract ar archivesunix ar libraryar file formatarchive extraction python
archive-formatbuild-tools

More Build Tools packages