Skip to main content

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.

Release files for libarx 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for libarx 0.4.2
File
libarx-0.4.2-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
libarx-0.4.2-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
libarx-0.4.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
libarx-0.4.2-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
libarx-0.4.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
libarx-0.4.2-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
libarx-0.4.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
libarx-0.4.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
libarx-0.4.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
libarx-0.4.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
libarx-0.4.2-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details
libarx-0.4.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 12.3 MB

Release files / libarx-0.4.2-cp314-cp314-win_amd64.whl

Download URL libarx-0.4.2-cp314-cp314-win_amd64.whl
Size 882.7 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
47eebc38dc11f8e5b0c9df6d66fc7d38c5e91e9105779b222527b0cf9b59193f
BLAKE2b-256 checksum
How to use checksums
7ce6e2859fc9bb68f39622405a8dbf0fdd4af803d373bc448710d2812455ec82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp314-cp314-macosx_11_0_arm64.whl

Download URL libarx-0.4.2-cp314-cp314-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0695ef840c1411491a2f2e0463637e8d1a7b465dbe42894285b44c128c11e5e1
BLAKE2b-256 checksum
How to use checksums
d404ecb8c552f619c8c946fd0da497da565d73aa26d302569395355a7e81140f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp313-cp313-win_amd64.whl

Download URL libarx-0.4.2-cp313-cp313-win_amd64.whl
Size 881.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
0eb1d2f5d8424dea784c02637a9ee0bbd209a15067b8a3bea4826f1145da49a4
BLAKE2b-256 checksum
How to use checksums
7da70c8edec195b0da2f90e327c9ee16611515e91870f9ec48396414b71ec64e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp313-cp313-macosx_11_0_arm64.whl

Download URL libarx-0.4.2-cp313-cp313-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f7d029f7aae06fa9b7d30d658e144c35d240933e74a813cf2714805f215125c8
BLAKE2b-256 checksum
How to use checksums
dbe77d1e292128772c868ea4455a1783d00e15e806dfd57bc7e6fa0cdcfde20f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp312-cp312-win_amd64.whl

Download URL libarx-0.4.2-cp312-cp312-win_amd64.whl
Size 882.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
79ea01bf982207bbb23e9380a1d042e4c37a34152e14d26ec4ac775c96359edb
BLAKE2b-256 checksum
How to use checksums
5b6e521f589eb772a5e049781605a11102815be9c95ef699aacb3d934dd1dcd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL libarx-0.4.2-cp312-cp312-manylinux_2_34_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
a1d1302c5c9c8841aada9e3614756fd87ed98ef2216b237cf8b563486da4111d
BLAKE2b-256 checksum
How to use checksums
352cc321b42fc915245dc68138beb94ea42dbbe5d770c2d9b4f525483a902ea7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL libarx-0.4.2-cp312-cp312-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ce853a07e91722a4a97bd918c2a81304e23a34644b09f718da85d1a2472ebd48
BLAKE2b-256 checksum
How to use checksums
7a212e9d8bba626ed7df138e3c39da99f80a2c3709db8b982ecb829f51be037d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp311-cp311-win_amd64.whl

Download URL libarx-0.4.2-cp311-cp311-win_amd64.whl
Size 884.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
fd8abee2716476348f387261a8ce6d63292b221f9f79bf380e39ea0968cf73db
BLAKE2b-256 checksum
How to use checksums
ee0536fad3fa250b19ffb803128c965af7be97a85ee51880560fe8eded7a4bce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL libarx-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
09fde00c352a4ed4e8d70170a7b39f4792313f65861c3335ac08494a28d6b2c4
BLAKE2b-256 checksum
How to use checksums
5a003cab3a9dcfd51bd1b18360e043a5f95962e295f21bb679a3c048f9c12038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp310-cp310-win_amd64.whl

Download URL libarx-0.4.2-cp310-cp310-win_amd64.whl
Size 881.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
044ab6f6775a1f79dc6ad1a7b126d51ff1c07ff77e4d01c04d636c3a549c51af
BLAKE2b-256 checksum
How to use checksums
7e1b1a142ecab65e5b9b859ce9ca56b5b97cbdc811fa3ec95adb04312572b183
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL libarx-0.4.2-cp310-cp310-manylinux_2_34_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
540236839e59006884657a20a33c17d056ff4ba80228d3c6932294ca226ad839
BLAKE2b-256 checksum
How to use checksums
6d2f852f2e907beaac66c1ddf3b6e68ec1a9c404965e479e889f9d1951627362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / libarx-0.4.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL libarx-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
24bb10834742267244b79f9fbd4dde6f05f8d8a95b25410a759f0c87ace67eaf
BLAKE2b-256 checksum
How to use checksums
549143a34720f51f4138fddc3dd7eb906a988b377d9e2662e048510aab874200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release history Release notifications | RSS feed

This release

0.4.2 This release

12 release files

0.3.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page