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.1-cp314-cp314-win_amd64.whl (872.7 kB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

libarx-0.4.1-cp313-cp313-win_amd64.whl (875.3 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

libarx-0.4.1-cp312-cp312-win_amd64.whl (875.4 kB view details)

Uploaded CPython 3.12Windows x86-64

libarx-0.4.1-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.1-cp312-cp312-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

libarx-0.4.1-cp311-cp311-win_amd64.whl (875.3 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

libarx-0.4.1-cp310-cp310-win_amd64.whl (875.3 kB view details)

Uploaded CPython 3.10Windows x86-64

libarx-0.4.1-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.1-cp310-cp310-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

libarx-0.4.1-cp39-cp39-win_amd64.whl (876.6 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for libarx-0.4.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 84034afd20d429f841875fb3ca05bd5cfca6e015d1e69150759a37fc90d7ef56
MD5 0ca0661860ba716bd6fe798701acbeb8
BLAKE2b-256 adf368e53f6e6750d2a63f96d6737d026d4c6df3653e509c8bf5790fbd8c6c1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for libarx-0.4.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a5f30f68da8950c8b7e7152393b109475fc279ba7816df789d2e618a3a24cb6b
MD5 acd687558e6221e4146da6b4782c63be
BLAKE2b-256 80c751a08ad4fac8e2c27f675d3df7f5a9f698494755de1f8fed8d6c15e6373a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for libarx-0.4.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d41d44b0b27e912ef77f175f0d7e64275180279f7c3c4f80018debe062774879
MD5 5aa9782b43d8c55718123e758717e8cd
BLAKE2b-256 8f989b8b9d759554636adf68f10ca896de052030766246c8495bb29ebff37184

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for libarx-0.4.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c38a62d826cea46bba59bc580c384531df8fc235ef758c092452bae68cb77319
MD5 5927b57c917c8294ca08603e7e5552c3
BLAKE2b-256 145c2b5477553454b4e25916b73b46d86491712632f6da9d13686bde737d6bea

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for libarx-0.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fde95d4323d57112dd1f64092bc1287357aa6292d0453fc7b76fef3ff11376fa
MD5 1201863cfebc36ed88d0edb5567cb2f2
BLAKE2b-256 712c9dbed8bff754984edc506ae432a5b38553a4ed0811af390e003a3332f779

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for libarx-0.4.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f679b6746fff7bade76c9f76452a9a3e6436f8b3e6a77b5d982f246a2aa16759
MD5 353a7ee5461f9bffb8cc5f9a96ce7a5b
BLAKE2b-256 71d8d94b7f4d76ad31fb76a77ffb47651438815f3217c99556f4c7fd96cf52d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for libarx-0.4.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57367240df4b393d2edb8cd2e6e18f1d9d7c28d5db225f1cabbcade9d5084993
MD5 3268bde511202809cdeeb390a508c6b1
BLAKE2b-256 56478f7baef33dee2bf342cca011314a495c32f5f7b174f194f928dfd41e5f01

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for libarx-0.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d0a58a0c9f4e530a41edfbd501aee96e24b120f6fad184ee1fa498c2fd7bf639
MD5 a03e90f72a9ac6316daab8a7f90a7af4
BLAKE2b-256 9301f49e55f13ecb3f7f6da6ba0b1d0c8ab316b27a12afa5da3eb254b1bda1ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for libarx-0.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e83389db847442a3614bf4c95a685575efa6a9af7d6268d2e455c8d0d8788db4
MD5 ede62ea9f57ad7183070f5b6df779218
BLAKE2b-256 b1432b85a10ca2076b2d5986fe75dd514b5924f35a8493c5c4bc4dc71e35ad88

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for libarx-0.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c7c9d9491ac0ef98d1bb07718076f411b1cc988aebeff4cf3939e35e23b406ed
MD5 a15d0d63d79ea5be5b828641353af31c
BLAKE2b-256 6de0e95c1d4fba10ede02ba6e1d299c2404a5c743061518cccc470744b045fc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for libarx-0.4.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f53998ee61050d6dae2857ca1a6821a915955f8105ed1b798842b47b763a64fe
MD5 af4e7ba4341f2676cb218f884e42d0ec
BLAKE2b-256 c4b434675b903f98273a968975a7be79dccea17838d3931f18f051a2bff5f46b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for libarx-0.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6d93a5b7d388fcabb98972ea2ede670c3692413d8e0053a2d60d933e496a3c5
MD5 cf32d71a6ca1103d5a5676dd4f554c33
BLAKE2b-256 b68c02597620e751d21d3f6bbaeda6a8e820d7c5a02542e2a4c9082716b6dff4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for libarx-0.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 54a1af9a16b3ac3190af1d6bed6e209ae8c84d66df253d0bf7040a4ea396731a
MD5 0670fdac8471cfb32ddde405ee111e93
BLAKE2b-256 d54ce47eb7ad361f04089f1cfd38eea7458a820796147dc5235ce7ba2753daab

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