Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.81 KB

README.md

File metadata and controls

69 lines (48 loc) · 1.81 KB

OnedataRESTFS

OnedataRESTFS is a PyFilesystem interface to Onedata virtual file system based on Onedata REST API.

As a PyFilesystem concrete class, OnedataRESTFS allows you to work with Onedata in the same way as any other supported filesystem.

Heavyweight alternative

To achieve the best performance, consider using a heavyweight cousin of OnedataRESTFS - OnedataFS. It takes advantage of direct storage access, a.k.a. DirectIO. However, it requires that the machine running OnedataFS has direct access to the underlying storage system. If it's not the case, OnedataRESTFS is a good choice, with identical functionality and comparable performance for ProxyIO data access mode.

Installing

You can install OnedataRESTFS from pip as follows:

pip install fs.onedatarestfs

Opening a OnedataRESTFS

Open an OnedataRESTFS by explicitly using the constructor:

from fs.onedatarestfs import OnedataRESTFS
onedata_onezone_host = "..."
onedata_access_token = "..."
odfs = OnedataRESTFS(onedata_onezone_host, onedata_access_token)

Or with a FS URL:

from fs import open_fs
odfs = open_fs('onedatarestfs://HOST?token=...')

Building and running tests

virtualenv -p /usr/bin/python3 venv
. venv/bin/activate

# Install tox
pip install coverage tox

# Run flake8 check
tox -c tox.ini -e flake8

# Run mypy typing check
tox -c tox.ini -e mypy

# Run PyFilesystem test suite
tox -c tox.ini -e fstest

Documentation