Skip to main content

Random Access Read-Only Tar Mount (Ratarmount) Library

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

import ratarmountcore as rmc

archive = rmc.open("foo.tar", recursive=True)
archive.listDir("/")
info = archive.getFileInfo("/bar")

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

Metadata

Release files for ratarmountcore 0.2.3

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.2.3
File Size Uploaded
ratarmountcore-0.2.3.tar.gz 54.0 kB Details

Built distribution (wheel)

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

Total release size: 114.7 kB

Release files / ratarmountcore-0.2.3.tar.gz

Download URL ratarmountcore-0.2.3.tar.gz
Size 54.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2a1c2d4e0e092fd95a52b7e356623e009e73dca9c34cc19d06a250a232709698
BLAKE2b-256 checksum
How to use checksums
8eb5f37db1f88e9ce652ec5fdb6ac4e59d50d16bc114da4eea35e0997b5cd1fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

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

Download URL ratarmountcore-0.2.3-py3-none-any.whl
Size 60.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe1c5a42f1c0d6d675d68f6e63803c1509484db53b2fee60622a19b567ee0d25
BLAKE2b-256 checksum
How to use checksums
6a58f342a54b9953b824042dfc472a8f17d17adaa49b6f0bdd9e535fc7313ef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

Release history Release notifications | RSS feed

0.11.1

2 release files

0.11.0

2 release files

0.10.4

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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