Skip to main content

XRootDPyFS is a PyFilesystem interface to XRootD.

Project description

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://pythonhosted.org/xrootdpyfs/> 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.1.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

xrootdpyfs-0.1.1-py2-none-any.whl (20.7 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: xrootdpyfs-0.1.1.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xrootdpyfs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 028582af29774310c075fa6b254c74586e2b96f3e4df08f79a8ec64a6b27944f
MD5 69ea7861949824742a9412f07cb012e5
BLAKE2b-256 a4ab42b8c6935ab5c25a5cf7acfdd2209668bba13660e1f19dd2e66ff335f0a7

See more details on using hashes here.

File details

Details for the file xrootdpyfs-0.1.1-py2-none-any.whl.

File metadata

File hashes

Hashes for xrootdpyfs-0.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 d114e3c94c9d5d2f79df4175ae07063118fc84fcd5f2ff302a7db025174cec48
MD5 0cce21e6be6e7283ae467256cb8510e6
BLAKE2b-256 66342d269928be831e424abc0c00e97e49e5e8c0bb93b8b628bd12d1dd4efb3c

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