Skip to main content

XRootDPyFS is a PyFilesystem-like interface for XRootD.

Project description

https://github.com/inveniosoftware/xrootdpyfs/actions?query=workflow%3ACI.svg?branch=master https://coveralls.io/repos/inveniosoftware/xrootdpyfs/badge.svg?branch=master https://pypip.in/v/xrootdpyfs/badge.svg

XRootDPyFS is a PyFilesystem-like interface to XRootD.

XRootD protocol aims at giving high performance, scalable fault tolerant access to data repositories of many kinds. The XRootDPyFS adds a high-level interface on top of the existing Python interface (pyxrootd) and makes it easy to e.g. copy a directory in parallel or recursively remove a directory.

Further documentation is available on https://xrootdpyfs.readthedocs.io/.

Getting started

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

Build the image:

$ docker build --platform linux/amd64 -t xrootd .

Run the container and launch xrootd:

$ docker run --platform linux/amd64 -h xrootdpyfs -it xrootd bash

You will see the logs in the stdout. Next, in another shell, connect the container and fire up an ipython shell:

$ docker ps  # find the container id
$ docker exec -it <container-id> bash
[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']

Reading files:

>>> f = fs.open("xrootdpyfs/test.txt")
>>> f.read()
b'Hello XRootD!\n'
>>> f.close()

Reading files using the readtext() method:

>>> fs.readtext("xrootdpyfs/test.txt")
b'Hello XRootD!\n'

Writing files:

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

Writing files using the writetext() method:

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

Development

The easiest way to develop is to build the Docker image and mount the source code as a volume to test any code modification with a running XRootD server:

$ docker build --platform linux/amd64 -t xrootd --progress=plain .
$ docker run --platform linux/amd64 -h xrootdpyfs -it -v <absolute path to this project>:/code xrootd bash
[xrootdpyfs@xrootdpyfs code]$ xrootd

In another shell:

$ docker ps  # find the container id
$ docker exec -it <container-id> bash
[xrootdpyfs@xrootdpyfs code]$ python -m pytest -vvv tests

If you want to test a specific version of xrootd, run:

$ docker build --platform linux/amd64 --build-arg xrootd_version=4.12.7 -t xrootd --progress=plain .

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 --platform linux/amd64 -t xrootd . && docker run --platform linux/amd64 -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-3.0.0a1.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xrootdpyfs-3.0.0a1-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file xrootdpyfs-3.0.0a1.tar.gz.

File metadata

  • Download URL: xrootdpyfs-3.0.0a1.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for xrootdpyfs-3.0.0a1.tar.gz
Algorithm Hash digest
SHA256 853d8632081168d8653f6b9d48d89aea48b85fb4dec2d987ce62425194cf7cd7
MD5 64bfbe2e9d6aa5c7e922dca71df0d27c
BLAKE2b-256 d9514773e2b8bd69481e96ec9b95639ad9d4b58396083b25e42ab0a757c45807

See more details on using hashes here.

File details

Details for the file xrootdpyfs-3.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: xrootdpyfs-3.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for xrootdpyfs-3.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f8b38fa1b7bb929be6ebe08062e03e827dcee31fc7043e7fff32631c558ba1c
MD5 79f6a9b3d60fdb4d1897fc9659f4676e
BLAKE2b-256 6bf29d7546775099ea01fbe48bb52f5841d3fdf5c0ddbf8a8cb2e015c3ba1041

See more details on using hashes here.

Supported by

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