============
XRootDPyFS
============
.. image:: https://github.com/inveniosoftware/xrootdpyfs/actions?query=workflow%3ACI.svg?branch=master
:target: https://github.com/inveniosoftware/xrootdpyfs/actions?query=workflow%3ACI
.. image:: https://coveralls.io/repos/inveniosoftware/xrootdpyfs/badge.svg?branch=master
:target: https://coveralls.io/r/inveniosoftware/xrootdpyfs
.. image:: https://pypip.in/v/xrootdpyfs/badge.svg
:target: https://crate.io/packages/xrootdpyfs/
XRootDPyFS is a PyFilesystem 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:
.. code-block:: console
$ docker build --platform linux/amd64 -t xrootd .
Run the container and launch `xrootd`:
.. code-block:: console
$ 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:
.. code-block:: console
$ 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']
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 open_fs
>>> fs = open_fs("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:
.. code-block:: console
$ 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:
.. code-block:: console
$ 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:
.. code-block:: console
$ 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:
.. code-block:: console
$ docker build --platform linux/amd64 -t xrootd . && docker run --platform linux/amd64 -h xrootdpyfs -it xrootd
Raw data
{
"_id": null,
"home_page": "https://github.com/inveniosoftware/xrootdpyfs",
"name": "xrootdpyfs",
"maintainer": "",
"docs_url": "https://pythonhosted.org/xrootdpyfs/",
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "xrootdpyfs",
"author": "CERN",
"author_email": "info@inveniosoftware.org",
"download_url": "https://files.pythonhosted.org/packages/03/79/75676fbb781c8e9efdaae8f9ec933f8194a993dc157e435d32eaa65f702c/xrootdpyfs-2.0.0.tar.gz",
"platform": "any",
"description": "============\n XRootDPyFS\n============\n\n.. image:: https://github.com/inveniosoftware/xrootdpyfs/actions?query=workflow%3ACI.svg?branch=master\n :target: https://github.com/inveniosoftware/xrootdpyfs/actions?query=workflow%3ACI\n.. image:: https://coveralls.io/repos/inveniosoftware/xrootdpyfs/badge.svg?branch=master\n :target: https://coveralls.io/r/inveniosoftware/xrootdpyfs\n.. image:: https://pypip.in/v/xrootdpyfs/badge.svg\n :target: https://crate.io/packages/xrootdpyfs/\n\n\nXRootDPyFS is a PyFilesystem interface to XRootD.\n\nXRootD protocol aims at giving high performance, scalable fault tolerant access\nto data repositories of many kinds. The XRootDPyFS adds a high-level interface\non top of the existing Python interface (pyxrootd) and makes it easy to e.g.\ncopy a directory in parallel or recursively remove a directory.\n\nFurther documentation is available on https://xrootdpyfs.readthedocs.io/.\n\nGetting started\n===============\n\nIf you just want to try out the library, the easiest is to use Docker.\n\nBuild the image:\n\n.. code-block:: console\n\n $ docker build --platform linux/amd64 -t xrootd .\n\nRun the container and launch `xrootd`:\n\n.. code-block:: console\n\n $ docker run --platform linux/amd64 -h xrootdpyfs -it xrootd bash\n\nYou will see the logs in the stdout. Next, in another shell, connect the container\nand fire up an ipython shell:\n\n.. code-block:: console\n\n $ docker ps # find the container id\n $ docker exec -it <container-id> bash\n [xrootdpyfs@xrootdpyfs code]$ ipython\n\n\nQuick examples\n--------------\n\nHere is a quick example of a file listing with the xrootd PyFilesystem\nintegration:\n\n >>> from xrootdpyfs import XRootDPyFS\n >>> fs = XRootDPyFS(\"root://localhost//tmp/\")\n >>> fs.listdir(\"xrootdpyfs\")\n ['test.txt']\n\nOr, alternatively using the PyFilesystem opener (note the first\n``import xrootdpyfs`` is required to ensure the XRootDPyFS opener is registered):\n\n >>> import xrootdpyfs\n >>> from fs.opener import open_fs\n >>> fs = open_fs(\"root://localhost//tmp/\")\n >>> fs.listdir(\"xrootdpyfs\")\n ['test.txt']\n\nReading files:\n\n >>> f = fs.open(\"xrootdpyfs/test.txt\")\n >>> f.read()\n b'Hello XRootD!\\n'\n >>> f.close()\n\nReading files using the ``readtext()`` method:\n\n >>> fs.readtext(\"xrootdpyfs/test.txt\")\n b'Hello XRootD!\\n'\n\nWriting files:\n\n >>> f = fs.open(\"xrootdpyfs/hello.txt\", \"w+\")\n >>> f.write(\"World\")\n >>> f.close()\n\nWriting files using the ``writetext()`` method:\n\n >>> fs.writetext(\"xrootdpyfs/test.txt\", \"World\")\n\nDevelopment\n===========\n\nThe easiest way to develop is to build the Docker image and mount\nthe source code as a volume to test any code modification with a\nrunning XRootD server:\n\n.. code-block:: console\n\n $ docker build --platform linux/amd64 -t xrootd --progress=plain .\n $ docker run --platform linux/amd64 -h xrootdpyfs -it -v <absolute path to this project>:/code xrootd bash\n [xrootdpyfs@xrootdpyfs code]$ xrootd\n\nIn another shell:\n\n.. code-block:: console\n\n $ docker ps # find the container id\n $ docker exec -it <container-id> bash\n [xrootdpyfs@xrootdpyfs code]$ python -m pytest -vvv tests\n\nIf you want to test a specific version of xrootd, run:\n\n.. code-block:: console\n\n $ docker build --platform linux/amd64 --build-arg xrootd_version=4.12.7 -t xrootd --progress=plain .\n\nDocumentation\n=============\nDocumentation is available at <http://xrootdpyfs.readthedocs.io/> or can be\nbuild using Sphinx::\n\n pip install Sphinx\n python setup.py build_sphinx\n\nTesting\n=======\nRunning the tests are most easily done using docker:\n\n.. code-block:: console\n\n $ docker build --platform linux/amd64 -t xrootd . && docker run --platform linux/amd64 -h xrootdpyfs -it xrootd\n\n\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "XRootDPyFS is a PyFilesystem interface for XRootD.",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/inveniosoftware/xrootdpyfs"
},
"split_keywords": [
"xrootdpyfs"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "61bff9118f013b175a29055599f556bf4e28c36c0e367a6fb9c5a3e0518ca260",
"md5": "9ad87f56bdf797005bbed610b7137fa7",
"sha256": "4340fe2cb506706d8734882cfc346a76b86d371de6b559a2f9c98430ac10cc1d"
},
"downloads": -1,
"filename": "xrootdpyfs-2.0.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ad87f56bdf797005bbed610b7137fa7",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 21587,
"upload_time": "2024-02-14T10:10:18",
"upload_time_iso_8601": "2024-02-14T10:10:18.254109Z",
"url": "https://files.pythonhosted.org/packages/61/bf/f9118f013b175a29055599f556bf4e28c36c0e367a6fb9c5a3e0518ca260/xrootdpyfs-2.0.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "037975676fbb781c8e9efdaae8f9ec933f8194a993dc157e435d32eaa65f702c",
"md5": "e522ada828604fd56b188cc8bb505327",
"sha256": "98921f179302afba14d747cc27f925125b6936016bc2fa12126cc2feb7535442"
},
"downloads": -1,
"filename": "xrootdpyfs-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "e522ada828604fd56b188cc8bb505327",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 41886,
"upload_time": "2024-02-14T10:10:20",
"upload_time_iso_8601": "2024-02-14T10:10:20.343540Z",
"url": "https://files.pythonhosted.org/packages/03/79/75676fbb781c8e9efdaae8f9ec933f8194a993dc157e435d32eaa65f702c/xrootdpyfs-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-14 10:10:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "inveniosoftware",
"github_project": "xrootdpyfs",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "xrootdpyfs"
}