{ "info": { "author": "Jing Wang", "author_email": "99jingw@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: System :: Filesystems" ], "description": "==================\nPython HDFS client\n==================\n\nBecause the world needs `yet `_ `another `_ `way `_ to talk to HDFS from Python.\n\nUsage\n=====\n\nThis library provides a Python client for `WebHDFS `_.\nNameNode HA is supported by passing in both NameNodes.\nResponses are returned as nice Python classes, and any failed operation will raise some subclass of ``HdfsException`` matching the Java exception.\n\nExample usage:\n\n.. code-block:: python\n\n >>> fs = pyhdfs.HdfsClient(hosts='nn1.example.com:50070,nn2.example.com:50070', user_name='someone')\n >>> fs.list_status('/')\n [FileStatus(pathSuffix='benchmarks', permission='777', type='DIRECTORY', ...), FileStatus(...), ...]\n >>> fs.listdir('/')\n ['benchmarks', 'hbase', 'solr', 'tmp', 'user', 'var']\n >>> fs.mkdirs('/fruit/x/y')\n True\n >>> fs.create('/fruit/apple', 'delicious')\n >>> fs.append('/fruit/apple', ' food')\n >>> with contextlib.closing(fs.open('/fruit/apple')) as f:\n ... f.read()\n ...\n b'delicious food'\n >>> fs.get_file_status('/fruit/apple')\n FileStatus(length=14, owner='someone', type='FILE', ...)\n >>> fs.get_file_status('/fruit/apple').owner\n 'someone'\n >>> fs.get_content_summary('/fruit')\n ContentSummary(directoryCount=3, fileCount=1, length=14, quota=-1, spaceConsumed=14, spaceQuota=-1)\n >>> list(fs.walk('/fruit'))\n [('/fruit', ['x'], ['apple']), ('/fruit/x', ['y'], []), ('/fruit/x/y', [], [])]\n >>> fs.exists('/fruit/apple')\n True\n >>> fs.delete('/fruit')\n Traceback (most recent call last):\n File \"\", line 1, in \n File \".../pyhdfs.py\", line 525, in delete\n ...\n pyhdfs.HdfsPathIsNotEmptyDirectoryException: `/fruit is non empty': Directory is not empty\n >>> fs.delete('/fruit', recursive=True)\n True\n >>> fs.exists('/fruit/apple')\n False\n >>> issubclass(pyhdfs.HdfsFileNotFoundException, pyhdfs.HdfsIOException)\n True\n\n\nYou can also pass the hostname as part of the URI:\n\n.. code-block:: python\n\n fs.list_status('//nn1.example.com:50070;nn2.example.com:50070/')\n\nThe methods and return values generally map directly to `WebHDFS endpoints `_.\nThe client also provides convenience methods that mimic Python ``os`` methods and HDFS CLI commands (e.g. ``walk`` and ``copy_to_local``).\n\n``pyhdfs`` logs all HDFS actions at the INFO level, so turning on INFO level logging will give you a debug record for your application.\n\nFor more information, see the `full API docs `_.\n\nInstalling\n==========\n\n``pip install pyhdfs``\n\nYou'll need Python 2.7 or Python 3.\n\nDevelopment testing\n===================\n\n.. image:: https://travis-ci.org/jingw/pyhdfs.svg?branch=master\n :target: https://travis-ci.org/jingw/pyhdfs\n\n.. image:: http://codecov.io/github/jingw/pyhdfs/coverage.svg?branch=master\n :target: http://codecov.io/github/jingw/pyhdfs?branch=master\n\nFirst run ``install-hdfs.sh x.y.z``, which will download, extract, and run the HDFS NN/DN processes in the current directory.\n(Replace ``x.y.z`` with a real version.)\nThen run the following commands.\nNote they will create and delete ``hdfs://localhost/tmp/pyhdfs_test``.\n\nPython 3::\n\n virtualenv3 --no-site-packages env3\n source env3/bin/activate\n pip3 install -e .\n pip3 install -r dev_requirements.txt\n py.test\n\nAnd again for Python 2 (after ``deactivate``)::\n\n virtualenv2 --no-site-packages env2\n source env2/bin/activate\n pip2 install -e .\n pip2 install -r dev_requirements.txt\n py.test", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jingw/pyhdfs", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "PyHDFS", "package_url": "https://pypi.org/project/PyHDFS/", "platform": "", "project_url": "https://pypi.org/project/PyHDFS/", "project_urls": { "Homepage": "https://github.com/jingw/pyhdfs" }, "release_url": "https://pypi.org/project/PyHDFS/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "Pure Python HDFS client", "version": "0.2.2" }, "last_serial": 5402822, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ad809e6f7e91d3750a369fd9fe32d354", "sha256": "7442809e1f3288516b6e759ea52f3acf5797ba75b14f339e8bb87902dfe5d2a0" }, "downloads": -1, "filename": "PyHDFS-0.1.0.tar.gz", "has_sig": true, "md5_digest": "ad809e6f7e91d3750a369fd9fe32d354", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9739, "upload_time": "2015-03-05T05:48:01", "url": "https://files.pythonhosted.org/packages/3c/f5/756a76ba9706ad22b547949dfc4f613fcdcbccb4d2771df10333c3af3169/PyHDFS-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "94632312ac489ef8aa8d28f935fb587e", "sha256": "c1e435b64dd4e046a984a9408f7ebb1f4499182c9bb063aa76b1d73c818fbb0e" }, "downloads": -1, "filename": "PyHDFS-0.1.1.tar.gz", "has_sig": true, "md5_digest": "94632312ac489ef8aa8d28f935fb587e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10818, "upload_time": "2015-03-22T23:50:26", "url": "https://files.pythonhosted.org/packages/63/d7/ee567570af5e98a6dae8328c2779bbeda3a2972babe2310effad98a004e2/PyHDFS-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "07da54b5c45a33c20080e263cac329e4", "sha256": "cddc4c6b754ca070cbaf6b9a9055945b277c596d644f238c4d0a75d03cc587e1" }, "downloads": -1, "filename": "PyHDFS-0.1.2.tar.gz", "has_sig": true, "md5_digest": "07da54b5c45a33c20080e263cac329e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11077, "upload_time": "2016-10-29T04:24:43", "url": "https://files.pythonhosted.org/packages/02/f4/df64ed9a1a1f6d2a788e172adef6613ded9fecd4d1ee93835f1d0cc4cf82/PyHDFS-0.1.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "9157f1faf88bef491718c20d606e34d4", "sha256": "1e002580b640f0da3b021075dfa646244cd7e1a1d36d02fc99421e3901d326e8" }, "downloads": -1, "filename": "PyHDFS-0.2.1.tar.gz", "has_sig": true, "md5_digest": "9157f1faf88bef491718c20d606e34d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13580, "upload_time": "2017-09-23T03:56:37", "url": "https://files.pythonhosted.org/packages/16/9f/a358e199f2d99229ff470e0063e26111fd0121ef034b853d9b9c0fd26b72/PyHDFS-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "4986ce055ad5b698b43cbb27b79f0c9e", "sha256": "d5c5676ce5c00dc99dd1522fbe1f1a6e3e318f34972f6443cd82f8a85294f230" }, "downloads": -1, "filename": "PyHDFS-0.2.2.tar.gz", "has_sig": false, "md5_digest": "4986ce055ad5b698b43cbb27b79f0c9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11951, "upload_time": "2019-06-15T03:16:15", "url": "https://files.pythonhosted.org/packages/1b/c4/707adc71153c245b25b9010b3ed002364199291c98f518dc559ded6ae6e8/PyHDFS-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4986ce055ad5b698b43cbb27b79f0c9e", "sha256": "d5c5676ce5c00dc99dd1522fbe1f1a6e3e318f34972f6443cd82f8a85294f230" }, "downloads": -1, "filename": "PyHDFS-0.2.2.tar.gz", "has_sig": false, "md5_digest": "4986ce055ad5b698b43cbb27b79f0c9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11951, "upload_time": "2019-06-15T03:16:15", "url": "https://files.pythonhosted.org/packages/1b/c4/707adc71153c245b25b9010b3ed002364199291c98f518dc559ded6ae6e8/PyHDFS-0.2.2.tar.gz" } ] }