Skip to main content

Random Access Read-Only Tar Mount (Ratarmount) Library

PyPI version Python Version Downloads License Changelog

This is the library used as backend by ratarmount (CLI). For a full description including motivation and performance comparisons, see ratarmount.

Table of Contents

  1. Installation
  2. Usage

Installation

PIP Package Installation

In many cases a simple pip install should work:

pip install ratarmountcore[full]

If there is trouble with one of the compression dependencies, first try installing it without dependencies:

pip install ratarmountcore

And if that works, only install those dependencies you need, e.g.:

pip install ratarmountcore[bzip2,gzip]

You can install the latest development version with:

python3 -m pip install --user --force-reinstall 'git+https://github.com/mxmlnkn/ratarmount.git@develop#egginfo=ratarmountcore&subdirectory=core'

Dependencies

Python 3.6+ and preferably pip 19.0+ are required. These should be preinstalled on most systems.

Ratarmountcore has as few required dependencies as necessary in order to cause the least troubles on all possible systems. This means that only uncompressed TAR and ZIP support will work by default. All optional dependencies are offered as extras.

Extras

Ratarmountcore offers these extras (optional dependencies):

  • full, bzip2, gzip, rar, xz, zip, zstd

Full includes all dependencies of the other extras. The zip extra is currently only a placeholder because the built-in zipfile module is being used.

In order to install one of these extract, append them in brackets:

python3 -m pip install --user ratarmount[bzip2]

If you are installing on a system for which there exists no manylinux wheel, then you'll have to install dependencies required to build from source:

sudo apt install python3 python3-pip fuse build-essential software-properties-common zlib1g-dev libzstd-dev liblzma-dev

Usage

This library offers an interface which is sufficient to work with FUSE. This MountSource interface has methods for listing paths and getting file metadata and contents.

The ratarmountcore library offers multiple implementations of MountSource for different archive formats:

  • SQLiteIndexedTar: This is the oldest and most powerful implementation. It supports fast access to files inside (compressed) TARs.
  • RarMountSource: An implementation for RARs using rarfile.
  • ZipMountSource: An implementation for ZIPs using zipfile.
  • FolderMountSource: An implementation taking an existing folder as input.

There also are these functional implementations of MountSource:

  • UnionMountSource: Takes multiple MountSource implementations and shows a merged view of their file hierarchy.
  • FileVersionLayer: Takes a MountSource as input, decodes the requested paths, also accepting <file>.version/<number> paths, and calls the methods of the MountSource with the given file version.
  • AutoMountLayer: Takes one MountSource, goes over all its files and mounts archives recursively in a similar manner to UnionMountSource.

The factory function open opens one of the archive MountSource implementations according to the file type.

Mount Source Class Diagram

Example

from ratarmountcore.mountsource.factory import open_mount_source

archive = open_mount_source("foo.tar", recursive=True)
print(archive.list("/"))
info = archive.lookup("/bar")

print("Contents of /bar:")
with archive.open(info) as file:
    print(file.read())

Metadata

Release files for ratarmountcore 0.11.1

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

Source distribution (sdist)

Source distribution for ratarmountcore 0.11.1
File Size Uploaded Provenance
ratarmountcore-0.11.1.tar.gz 220.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ratarmountcore 0.11.1
File Interpreter ABI Platform
ratarmountcore-0.11.1-py3-none-any.whl Python 3 none any Details

Total release size: 437.2 kB

Release files / ratarmountcore-0.11.1.tar.gz

Download URL ratarmountcore-0.11.1.tar.gz
Size 220.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9b05690c6ac0e561e77c5cdbc1559447233b2fc6bd37ad1e9b29acc99dec509d
BLAKE2b-256 checksum
How to use checksums
adc6372bb4ee86a069bfb39998f6056cdf65f1c79a70c3b91954041b996dfe79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / ratarmountcore-0.11.1-py3-none-any.whl

Download URL ratarmountcore-0.11.1-py3-none-any.whl
Size 217.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba3003bb0815831002ef1691626d9ef79f6169c8fb51a3fb39a0990b567a85a1
BLAKE2b-256 checksum
How to use checksums
5d4824e7ae57aa3e2dc68f6ad0356f70d374f13ba716637df1007ce3e9380b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for ratarmountcore 0.11.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.11.1 This release

2 release files No provenance

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