Registry / serialization / arpy
library2.3.0pypypi✓ verified 84d ago

arpy is a Python library for reading and writing Unix archive (ar) files, commonly used for static libraries (.a) and Debian packages (.deb). Version 2.3.0 supports Python 3.6+. It provides a simple interface to iterate over archive members and extract or add files.

pip install arpy
INSTALL
IMPORT
SIG · ARPY
A
arpy
serializationpythonv2.3.0
Install
2.4s avg
Import
11ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.006s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Archive
from arpy import Archive

Open an existing ar file and list its members.

from arpy import Archive with Archive('test.ar') as archive: for entry in archive: print(entry.name, entry.size)
Debug
Known issues
gotchaThe Archive class context manager does not close the file on __exit__ in some versions; manually call .close() if needed.
fix
Explicitly call archive.close() after use, or upgrade to 2.3.0+.
affects: <2.3.0
gotchaWriting archives: the write() method expects bytes, not str. Passing a string will raise a TypeError.
fix
Ensure data is bytes: archive.write(entry_name, b'data').
affects: all
breakingIn version 2.0.0, the API changed from old-style (archive = Archive('file'); archive.read()) to context manager. Old code will break.
fix
Use 'with Archive(...) as archive:' pattern. See docs.
affects: <=1.x
Errors
Common errors & fixes
AttributeError: module 'arpy' has no attribute 'Archive'
Importing incorrectly, e.g., 'import arpy' then using arpy.Archive instead of from arpy import Archive.
fix
Use 'from arpy import Archive'.
TypeError: write() argument must be a bytes-like object, not 'str'
Passing a string to Archive.write() instead of bytes.
fix
Encode string to bytes: archive.write('file.txt', 'content'.encode()).
FileNotFoundError: [Errno 2] No such file or directory: 'test.ar'
Trying to open a nonexistent archive for reading.
fix
Check the file path exists, or create a new archive with mode='w'.
Upgrade
Version history
2.3.0latest on PyPI · released Jun 11, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources
arpy — pip install arpy · libregistry