ratarmountcore


Nameratarmountcore JSON
Version 0.7.0 PyPI version JSON
download
home_pagehttps://github.com/mxmlnkn/ratarmount/ratarmountcore
SummaryRandom Access Read-Only Tar Mount Library
upload_time2024-04-07 13:35:36
maintainerNone
docs_urlNone
authorMaximilian Knespel
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Random Access Read-Only Tar Mount (Ratarmount) Library

[![PyPI version](https://badge.fury.io/py/ratarmountcore.svg)](https://badge.fury.io/py/ratarmountcore)
[![Python Version](https://img.shields.io/pypi/pyversions/ratarmountcore)](https://pypi.org/project/ratarmountcore/)
[![Downloads](https://static.pepy.tech/badge/ratarmountcore/month)](https://pepy.tech/project/ratarmountcore)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)
[![Changelog](https://img.shields.io/badge/Changelog-Markdown-blue)](https://github.com/mxmlnkn/ratarmount/blob/master/core/CHANGELOG.md)

This is the library used as backend by ratarmount (CLI).
For a full description including motivation and performance comparisons, see [ratarmount](https://github.com/mxmlnkn/ratarmount).


# Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)


# Installation


## PIP Package Installation

In many cases a simple pip install should work:

```bash
pip install ratarmountcore[full]
```

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

```bash
pip install ratarmountcore
```

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

```bash
pip install ratarmountcore[bzip2,gzip]
```

You can install the latest development version with:

```bash
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:

```bash
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:

```bash
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](doc/MountSource.png)](doc/MountSource.svg)


## Example

```Python3
import ratarmountcore as rmc

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

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mxmlnkn/ratarmount/ratarmountcore",
    "name": "ratarmountcore",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Maximilian Knespel",
    "author_email": "mxmlnkn@github.de",
    "download_url": "https://files.pythonhosted.org/packages/8d/38/0e00cac83b7bc171510fd1bdc27d92d94aff1a7a4b6d4af6c8b41bddece0/ratarmountcore-0.7.0.tar.gz",
    "platform": null,
    "description": "# Random Access Read-Only Tar Mount (Ratarmount) Library\n\n[![PyPI version](https://badge.fury.io/py/ratarmountcore.svg)](https://badge.fury.io/py/ratarmountcore)\n[![Python Version](https://img.shields.io/pypi/pyversions/ratarmountcore)](https://pypi.org/project/ratarmountcore/)\n[![Downloads](https://static.pepy.tech/badge/ratarmountcore/month)](https://pepy.tech/project/ratarmountcore)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n[![Changelog](https://img.shields.io/badge/Changelog-Markdown-blue)](https://github.com/mxmlnkn/ratarmount/blob/master/core/CHANGELOG.md)\n\nThis is the library used as backend by ratarmount (CLI).\nFor a full description including motivation and performance comparisons, see [ratarmount](https://github.com/mxmlnkn/ratarmount).\n\n\n# Table of Contents\n\n1. [Installation](#installation)\n2. [Usage](#usage)\n\n\n# Installation\n\n\n## PIP Package Installation\n\nIn many cases a simple pip install should work:\n\n```bash\npip install ratarmountcore[full]\n```\n\nIf there is trouble with one of the compression dependencies, first try installing it without dependencies:\n\n```bash\npip install ratarmountcore\n```\n\nAnd if that works, only install those dependencies you need, e.g.:\n\n```bash\npip install ratarmountcore[bzip2,gzip]\n```\n\nYou can install the latest development version with:\n\n```bash\npython3 -m pip install --user --force-reinstall 'git+https://github.com/mxmlnkn/ratarmount.git@develop#egginfo=ratarmountcore&subdirectory=core'\n```\n\n\n## Dependencies\n\nPython 3.6+ and preferably pip 19.0+ are required.\nThese should be preinstalled on most systems.\n\nRatarmountcore has as few required dependencies as necessary in order to cause the least troubles on all possible systems.\nThis means that only uncompressed TAR and ZIP support will work by default.\nAll optional dependencies are offered as extras.\n\n\n## Extras\n\nRatarmountcore offers these extras (optional dependencies):\n\n - full, bzip2, gzip, rar, xz, zip, zstd\n\nFull includes all dependencies of the other extras.\nThe `zip` extra is currently only a placeholder because the built-in `zipfile` module is being used.\n\nIn order to install one of these extract, append them in brackets:\n\n```bash\npython3 -m pip install --user ratarmount[bzip2]\n```\n\nIf 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:\n\n```bash\nsudo apt install python3 python3-pip fuse build-essential software-properties-common zlib1g-dev libzstd-dev liblzma-dev\n```\n\n\n# Usage\n\nThis library offers an interface which is sufficient to work with FUSE.\nThis `MountSource` interface has methods for listing paths and getting file metadata and contents.\n\nThe ratarmountcore library offers multiple implementations of `MountSource` for different archive formats:\n\n - `SQLiteIndexedTar`: \n    This is the oldest and most powerful implementation.\n    It supports fast access to files inside (compressed) TARs.\n - `RarMountSource`: An implementation for RARs using rarfile.\n - `ZipMountSource`: An implementation for ZIPs using zipfile.\n - `FolderMountSource`: An implementation taking an existing folder as input.\n\nThere also are these functional implementations of `MountSource`:\n\n - `UnionMountSource`: Takes multiple MountSource implementations and shows a merged view of their file hierarchy.\n - `FileVersionLayer`:\n    Takes a MountSource as input, decodes the requested paths, also accepting `<file>.version/<number>` paths,\n    and calls the methods of the `MountSource` with the given file version.\n - `AutoMountLayer`: \n    Takes one `MountSource`, goes over all its files and mounts archives recursively in a similar manner to `UnionMountSource`.\n\nThe factory function `open` opens one of the archive `MountSource` implementations according to the file type.\n\n[![Mount Source Class Diagram](doc/MountSource.png)](doc/MountSource.svg)\n\n\n## Example\n\n```Python3\nimport ratarmountcore as rmc\n\narchive = rmc.open(\"foo.tar\", recursive=True)\nprint(archive.listDir(\"/\"))\ninfo = archive.getFileInfo(\"/bar\")\n\nprint(\"Contents of /bar:\")\nwith archive.open(info) as file:\n    print(file.read())\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Random Access Read-Only Tar Mount Library",
    "version": "0.7.0",
    "project_urls": {
        "Homepage": "https://github.com/mxmlnkn/ratarmount/ratarmountcore"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fc6d596be431eede584f30bba46e3fe3a304395c90a0797e2e761ee520819e4b",
                "md5": "03eaf6467a55307038f501e5be7e7f0a",
                "sha256": "c8421302b5ba23edfd3181c67ad354f8816f3ae4747a5408b811ef1ef9d62cab"
            },
            "downloads": -1,
            "filename": "ratarmountcore-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "03eaf6467a55307038f501e5be7e7f0a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 97527,
            "upload_time": "2024-04-07T13:35:35",
            "upload_time_iso_8601": "2024-04-07T13:35:35.128796Z",
            "url": "https://files.pythonhosted.org/packages/fc/6d/596be431eede584f30bba46e3fe3a304395c90a0797e2e761ee520819e4b/ratarmountcore-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d380e00cac83b7bc171510fd1bdc27d92d94aff1a7a4b6d4af6c8b41bddece0",
                "md5": "7b90911d0ee2ecb3d167bfd6036dd0c8",
                "sha256": "b9a89654715197985f8b68e04fbae77dc176a43e2cf81a89705ecc3c22eb011c"
            },
            "downloads": -1,
            "filename": "ratarmountcore-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7b90911d0ee2ecb3d167bfd6036dd0c8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 103399,
            "upload_time": "2024-04-07T13:35:36",
            "upload_time_iso_8601": "2024-04-07T13:35:36.487656Z",
            "url": "https://files.pythonhosted.org/packages/8d/38/0e00cac83b7bc171510fd1bdc27d92d94aff1a7a4b6d4af6c8b41bddece0/ratarmountcore-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-07 13:35:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mxmlnkn",
    "github_project": "ratarmount",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ratarmountcore"
}
        
Elapsed time: 0.23275s