{ "info": { "author": "Ronnie Sahlberg", "author_email": "ronniesahlberg@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: C", "Programming Language :: Python", "Topic :: Communications :: File Sharing", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Filesystems" ], "description": "This module is an NFS client for python.\nThis project is hosted at https://github.com/sahlberg/libnfs-python\n\nThis module depends on the libnfs library.\nYou must first install libnfs before you can use this module.\nLibnfs can be found at https://github.com/sahlberg/libnfs\n\n\nThe two main classes in this module are NFS and NFSFH.\nNFS represents an NFS context that describes a mount point.\nNFSFH is the main class that implements a file-like object for NFS files.\n\n\nLICENSE\n=======\nThis module is distributed under LGPL version 2.1.\nPlease see COPYING for the full text of this license.\n\n\nContext-full access\n===================\nIn the context-full mode you will first need to mount an NFS share and create\nan NFS context before you can access any files. This NFS context is then used\nfor all future access to files in that mount point.\n\nThe benefit with this mode is that since performing the actual NFS mount is\nvery expensive you only need to perform it once, when creating the NFS object\nand can reuse the mount for any future files you want to access.\n\nIn this mode absolute paths are relative to the mount point for the NFS object.\n\nExample:\n--------\nimport libnfs\nnfs = libnfs.NFS('nfs://127.0.0.1/data/tmp/')\na = nfs.open('/foo-test', mode='w+')\na.write(\"Test string\")\na.close()\nprint nfs.open('/foo-test', mode='r').read()\n\n\nContext-free access\n===================\nThis module also provides a mode where you can directly open and access\na file-like object without first having to instantiate a NFS mount.\nIn this case the file-like object will internally create an NFS mount\nfor the duration of the lifespan of the file-like object.\n\nIn this mode you invoke the libnfs.open() function with an NFS url\nthat points to a file :\n\nExample:\n--------\nimport libnfs\na = libnfs.open('nfs://127.0.0.1/data/tmp/foo-test', mode='w+')\na.write(\"Test string\")\na.close()\nprint libnfs.open('nfs://127.0.0.1/data/tmp/foo-test', mode='r').read()\n\nIn the example above we create two instances of a file-like object. First\nwe create and write to the file and second time we read the file back and\nprint it. This is however both expensive and potentially poor performing.\nThe reason is that when we use context-free file-like objects we have to\ncreate an NFS mount internally for each object and this is expensive.\n\nBasically, when creating an NFS mount, the NFS protocol requires that we\nperform the following operations/roundtrips :\n\nCreating an NFS context:\n------------------------\n1, Establish TCP connection to portmapper (TCP port 111) on the server.\n2, Send a Portmapper NULL command to verify we are connected to a genuine\n Portmapper and that it is alive.\n3, Send a Portmapper GetPort command to fetch which port the MOUNT daemon\n is running on.\n Close the TCP connection.\n4, Establish a TCP connection to the MOUNT daemon\n5, Send a MOUNT NULL command to verify the MOUNT daemon is alive.\n6, Send a MOUNT MNT command to fetch the NFS file handle for the mount point.\n Close the TCP connection.\n7, Establish TCP connection to portmapper (TCP port 111) on the server.\n8, Send a Portmapper NULL command to verify we are connected to a genuine\n Portmapper and that it is alive.\n9, Send a Portmapper GetPort command to fetch which port the DAEMON daemon\n is running on.\n Close the TCP connection.\n10, Establish a TCP connection to the NFS daemon\n11, Send a NFS NULL command to verify the NFS daemon is alive.\n12, Send a NFS FSINFO command to fetch some basic information about the\n filesystem we just mounted.\n13, Send a NFS GETATTR command to fetch some information about the root\n directory for this mount.\n\nWhen using context-free handles we have to perform these steps every time\na new file-like object is created making it very expensive.\n\nThe benefit with context-free handles is that they are very convenient to use.\nJust pass an NFS url to the libnfs.open() function and you have a file-like\nobject. The drawback is that every context-free handle have to perform their\nown NFS mount internally. If you plan to access multiple/many files you\nshould consider using context-full handles instead.\n\n\nMAILING LIST\n============\nA libnfs-python mailing list is available at\nhttp://groups.google.com/group/libnfs-python\nAnnouncements of new versions of libnfs-python will be posted to this list.\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/sahlberg/libnfs-python/libnfs-1.0-4.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sahlberg/libnfs-python/", "keywords": "", "license": "LGPLv2.1", "maintainer": "", "maintainer_email": "", "name": "libnfs", "package_url": "https://pypi.org/project/libnfs/", "platform": "any", "project_url": "https://pypi.org/project/libnfs/", "project_urls": { "Download": "https://github.com/sahlberg/libnfs-python/libnfs-1.0-4.tar.gz", "Homepage": "https://github.com/sahlberg/libnfs-python/" }, "release_url": "https://pypi.org/project/libnfs/1.0.post4/", "requires_dist": null, "requires_python": "", "summary": "NFS client for Python.", "version": "1.0.post4" }, "last_serial": 2446010, "releases": { "1.0.post4": [ { "comment_text": "", "digests": { "md5": "c25f3e111c003e96b4e51789aaf8dcc4", "sha256": "0dd1a78266151eca00d3b21414691c94d28744de3e891681aa3b54c277a02cc0" }, "downloads": -1, "filename": "libnfs-1.0.post4.tar.gz", "has_sig": false, "md5_digest": "c25f3e111c003e96b4e51789aaf8dcc4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48383, "upload_time": "2016-11-06T22:55:10", "url": "https://files.pythonhosted.org/packages/e5/d6/5b6ad2d2838a5e077417daaae31d749d06c418c91e520eaad80e1f363547/libnfs-1.0.post4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c25f3e111c003e96b4e51789aaf8dcc4", "sha256": "0dd1a78266151eca00d3b21414691c94d28744de3e891681aa3b54c277a02cc0" }, "downloads": -1, "filename": "libnfs-1.0.post4.tar.gz", "has_sig": false, "md5_digest": "c25f3e111c003e96b4e51789aaf8dcc4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48383, "upload_time": "2016-11-06T22:55:10", "url": "https://files.pythonhosted.org/packages/e5/d6/5b6ad2d2838a5e077417daaae31d749d06c418c91e520eaad80e1f363547/libnfs-1.0.post4.tar.gz" } ] }