Skip to main content

XRootDPyFS is a PyFilesystem interface to XRootD.

Project description

https://travis-ci.org/inveniosoftware/xrootdpyfs.svg?branch=master https://coveralls.io/repos/inveniosoftware/xrootdpyfs/badge.svg?branch=master https://pypip.in/v/xrootdpyfs/badge.svg

XRootDPyFS is a PyFilesystem interface to XRootD.

Getting started

If you just want to try out the library, the easiest is to use Docker.

$ docker build -t xrootd .
$ docker run -h xrootdpyfs -it xrootd bash

Next, start a XRootD server in the container and fire up an ipython shell:

[xrootdpyfs@xrootdpyfs code]$ xrootd -b -l /dev/null
[xrootdpyfs@xrootdpyfs code]$ ipython

Quick examples

Here is a quick example of a file listing with the xrootd PyFilesystem integration:

>>> from xrootdpyfs import XRootDPyFS
>>> fs = XRootDPyFS("root://localhost//tmp/")
>>> fs.listdir("xrootdpyfs")
['test.txt']

Or, alternatively using the PyFilesystem opener (note the first import xrootdpyfs is required to ensure the XRootDPyFS opener is registered):

>>> import xrootdpyfs
>>> from fs.opener import opener
>>> fs, path = opener.parse("root://localhost//tmp/")
>>> fs.listdir("xrootdpyfs")
[u'test.txt']

Reading files:

>>> f = fs.open("xrootdpyfs/test.txt")
>>> f.read()
'Welcome to xrootdpyfs!'
>>> f.close()

Reading files using the getcontents() method:

>>> fs.getcontents("xrootdpyfs/test.txt")
'Welcome to xrootdpyfs!'

Writing files:

>>> f = fs.open("xrootdpyfs/hello.txt", "w+")
>>> f.write("World")
>>> f.close()

Writing files using the setcontents() method:

>>> fs.setcontents("xrootdpyfs/test.txt", "World")

Documentation

Documentation is available at <http://xrootdpyfs.readthedocs.io/> or can be build using Sphinx:

pip install Sphinx
python setup.py build_sphinx

Testing

Running the tests are most easily done using docker:

$ docker build -t xrootd . && docker run -h xrootdpyfs -it xrootd

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xrootdpyfs-0.1.6.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

xrootdpyfs-0.1.6-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file xrootdpyfs-0.1.6.tar.gz.

File metadata

  • Download URL: xrootdpyfs-0.1.6.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4

File hashes

Hashes for xrootdpyfs-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8e83df06bba32824d02970849c092415b64ffb5487451432932ea9602923126e
MD5 512c80ecbebd509d98adb1d45705e3ec
BLAKE2b-256 6f693b637819b08eae511ccd0732ab9e23463ee76c7d8044f60ecffe5320af48

See more details on using hashes here.

File details

Details for the file xrootdpyfs-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: xrootdpyfs-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4

File hashes

Hashes for xrootdpyfs-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d30fe81af00e9d1015230736630719b6b9468fd6390294980cb50b52c5044d0b
MD5 4284d12f9eecca053016e30bb2bd972f
BLAKE2b-256 8d6ab8f02034d8e0310f3a8a434c60263e6ac87b3772866ff52939d61bb144dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page