Skip to main content

Read and create arx archives.

Project description

libarx: A Python Wrapper for the Arx Archive Library

libarx is a Python library providing a user-friendly interface to interact with Arx archives. Arx is a high-performance, content-addressable archive format. This library allows you to easily create, read, and manipulate Arx archives from your Python code.

Key Features

  • Create Arx archives: Easily create new Arx archives from files and directories.
  • Read Arx archives: Efficiently read and extract data from existing Arx archives.
  • Iterate over archive contents: Traverse the archive's tree structure and access individual entries.
  • Access individual entries: Directly access specific files within the archive by path.
  • Stream-based access: Read file contents as streams, optimizing memory usage for large files.

Installation

Install it using pip:

pip install libarx

Our PyPI wheels bundle the Rust libarx and are available for the following platforms:

  • macOS for x86_64
  • GNU/Linux for x86_64
  • Windows for x64

Wheels are available for CPython only.

Users on other platforms can install the source distribution (see Building below).

Usage Examples

Creating an Archive

import libarx

# Create a new archive (replace with your desired output path)
archive_path = "my_archive.arx"
with libarx.Creator(archive_path) as creator:
    # Add files and directories to the archive
    creator.add("path/to/file1.txt")  #adds file
    creator.add("path/to/directory") #adds directory and its content recursively

Reading an Archive

import libarx

archive_path = "my_archive.arx"

# Open the archive
arx = libarx.Arx(archive_path)

def iterate(iterable, root=""):
    for entry in iterable:
        path = root + "/" + entry.path
        print(f"Entry: {path}")
        if entry.is_file():
            content_stream = entry.get_content()
            print(f"  Content size: {content_stream.size()} bytes")
            content = content_stream.read(min(100, content_stream.size()))
            print(f"  Content: {content}")
        elif entry.is_dir():
            print(f"  Nb Children: {entry.nb_childen()}")
            loop_on_entry_generator(entry)
        elif entry.is_link():
            print(f"  Link to {entry.get_target()}")

# Walk the entries in the archive
iterate(arx)

# Access a specific entry
specific_entry = arx.get_entry("path/to/file1.txt")
assert specific_entry.path == "file1.txt"
assert entry.parent.path == "to"
assert entry.parent.parent.path == "path"
assert entry.parent.parent.parent == None

#Extract the archive
arx.extract("extracted/archive/path")

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Sponsoring

I (@mgautierfr) am a freelance developer. All jubako projects are created in my free time, which competes with my paid work. If you want me to be able to spend more time on Jubako projects, please consider sponsoring me. You can also donate on liberapay or buy me a coffee.

License

This project is licensed under the MIT License - see the LICENSE-MIT file for details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

libarx-0.4.0-cp314-cp314-win_amd64.whl (845.1 kB view details)

Uploaded CPython 3.14Windows x86-64

libarx-0.4.0-cp314-cp314-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

libarx-0.4.0-cp313-cp313-win_amd64.whl (847.4 kB view details)

Uploaded CPython 3.13Windows x86-64

libarx-0.4.0-cp313-cp313-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

libarx-0.4.0-cp312-cp312-win_amd64.whl (847.9 kB view details)

Uploaded CPython 3.12Windows x86-64

libarx-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

libarx-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

libarx-0.4.0-cp311-cp311-win_amd64.whl (846.6 kB view details)

Uploaded CPython 3.11Windows x86-64

libarx-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

libarx-0.4.0-cp310-cp310-win_amd64.whl (846.3 kB view details)

Uploaded CPython 3.10Windows x86-64

libarx-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

libarx-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

libarx-0.4.0-cp39-cp39-win_amd64.whl (847.8 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file libarx-0.4.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: libarx-0.4.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 845.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for libarx-0.4.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 55bbe9233ce037e0db74da6c0738aad4b8c80e6e448f988ab40d9c084ae7f9dd
MD5 bbc9c413f448facb92516525456df79f
BLAKE2b-256 e14dca220521ef2f899e35c0fc5be22f7f27cc915274dc5357bfba977a061e18

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libarx-0.4.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa8cbffad0057ff3ceb7b136b2ff72bcabf16ff257899fbbfc44a48f7479d955
MD5 a94dabd9058d9a99808dcc6cf46087f2
BLAKE2b-256 406a27da84e93972717269cb7dbf1307cd845899dfc71f31f9d684e81c5b9855

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: libarx-0.4.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 847.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for libarx-0.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 74f20ce107f7f4eb9360517173f370c4961f413860442a3bbd7f9a8e9d9838ec
MD5 e194462ddbf72dd1d22fb4fa5d715343
BLAKE2b-256 ba15cf600d32ef899072ba1b7be57bc2f5595f0b28a9bcc185ea467249f2f78d

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libarx-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 755d544d7525133bdf787f28e98635b17842ebe22c4bd05c8d62760b1c42dc98
MD5 451a13baf6da82243b71cea396bdf28e
BLAKE2b-256 d63e5e6b580e2565a3245ba1341de7cf2909203ff100f22d5273b0599ee5db06

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: libarx-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 847.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for libarx-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 14c5002d5fac2213a20580be6f35b1b8a74ec66279aa28577ccf60580dee28e4
MD5 8dac7731d9bebeea041957dad67192a6
BLAKE2b-256 fed9f63ffca6692331cfa36bbdf4f86f71e0e7dc33db293cc993bc3949ddc5fa

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for libarx-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1bf65f0f39dafd6a135bdf31b9bf699825a0e57d224247234ea76dcd3bbd2866
MD5 b74c76b6dd2b5223deba3704df258549
BLAKE2b-256 a50f03c00350624113222b8c2d90948198ede6b26a2d4447ba04f128113eff03

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libarx-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4cacfe5503adfa294c45151ec77063538ef40b81bd9b39b25282730607d433c3
MD5 9afdd465d43672c7380501a03335b10d
BLAKE2b-256 3929c27704ff94dab47ba6284e221ebe868fec4596bfb2c8ccc1a6de3d2670cb

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: libarx-0.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 846.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for libarx-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2517aa08743625c0dd26453067ff199d64ac9fbe8cc70a57dfb3db86c11f0c71
MD5 3528d7ba76c3d212b8aaf63b1cfdc574
BLAKE2b-256 d549461266a2b4403e9ed69313220e34ccf0cdf3764d5ff4d804a75f8df62153

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libarx-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7be351af93a956bdc534c9e491ef13e8dd8c202732849b83719779e3486baf84
MD5 fb235c2f25beeb0c3926f35ecfa5f07c
BLAKE2b-256 49e1954ab6b08c05c1a322ef84d9d50562eb610960dde0c99f0c7de1eff70d8e

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: libarx-0.4.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 846.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for libarx-0.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b80bce4b8aaf2957cdf7a55d24c97fd1fa9078fc445942c403c5fe1feec702ec
MD5 7974c66ea2b2afa235639aedcb1ccb25
BLAKE2b-256 40b7ba86dabb9561ccccde38c0304d978cf6c516ba7d0f5483c7d11269459d70

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for libarx-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9d0ab52e0e471297da053da39635033ba42d1eeebf4fb00a59707c07b558ea89
MD5 83be2cf292ead4c62083e0e7be6b0e81
BLAKE2b-256 a9e74d85b4829e5fb540896202fdeba96eea96efbc5a42c9f2a0375b46e0dd9b

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libarx-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f142f5576cf0866cd97fbb3d4c67d18f48d2df5a8cb82fafce6478a0c098614
MD5 c59b26e1e834bda54f71c3ff6fafb96b
BLAKE2b-256 264f26209ad8f0196e9d11756a7e6a565cedc3a66d3eed7a81d0465d964ed609

See more details on using hashes here.

File details

Details for the file libarx-0.4.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: libarx-0.4.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 847.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for libarx-0.4.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8b62d047e7b5e7e280ae8b1385d2f91ae61dade2cb7d75b73d5b44065db754ba
MD5 fb13a6d38ea3c8488885586f0c308643
BLAKE2b-256 02965a92077e62cbc8acb95f63eac443145f07eb46e73c441923d91d4aaa0b8d

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