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://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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for xrootdpyfs-0.1.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 247d30df973073c773eff58bb1e3d423f5781c47df7ffa6b7d8a8f4a96ede8d2 |
|
MD5 | f4c6abe03e058339edebb30769453ae3 |
|
BLAKE2b-256 | dda9c25b18e40afe332fbfe846ce989b1c09c2bff33f5fc200b4657a25f619c2 |