PyWHDFS
API and interactive command line interface for Web HDFS.
$ pywhdfs -c prod
---------------------------------------------------
------------------- PYWEBHDFS 1.0.0 ------------------
-- Welcome to WEB HDFS interactive python shell. --
-- The WEB HDFS client is available as `CLIENT`. --
--------------------- Enjoy ! ---------------------
---------------------------------------------------
>>> CLIENT.list("/")
[u'admin', u'data', u'group', u'solr', u'system', u'tmp', u'user']
Functionalities
- Python Library for interacting with WebHDFS and HTTFS Rest API
- Support both secure (Kerberos,Token) and insecure clusters
- Supports HA cluster and handle namenode failover
- Supports HDFS federation with multiple nameservices and mount points.
- Json format clusters configuration.
- Command line interface to interactively interact with WebHDFS API on a python shell.
- Support concurency on uploads and downloads.
Getting started
$ easy_install pywhdfs
Some dependencies require the following packages to be also installed :
- krb5-devel krb5-libs
- gcc
- python-devel
Configuration
PyWHDFS uses a json configuration file that define the connection parameters for the different clusters. A simple configuration file looks like:
{
"clusters": [
{
"name": "prod",
"auth_mechanism": "GSSAPI",
"verify": false,
"truststore": "trust/store/path.jks",
"nameservices": [
{
"urls": ["http://first_namenode_url:50070" , "http://second_namenode_url:50070"],
"mounts": ["/"]
}
]
}
]
}
The configuration file is validated against a schema file
The default location of configuration file is "~/.webhdfs.cfg" but can can be overwritten using WEBHDFS_CONFIG environement variable.
USAGE
The interactive python shell client is the easiest way to use pywhdfs, but you can also instanciate the client manually :
>>>import pywhdfs.client as pywhdfs
>>>CLIENT = pywhdfs.WebHDFSClient(nameservices=[{'urls':[ "http://host1.hadoop.domain:50070" , "http://host2.hadoop.domain:50070"],'mounts':['/']}], auth_mechanism="GSSAPI", verify=False)
>>>CLIENT.list("/")
The interacctive shell requires the connection parameters for the cluster to be setup in the configuration file, and the cluster name needs to match the name you pass as argument.
Contributing
Feedback and Pull requests are very welcome!
Metadata
Release files for pywhdfs 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pywhdfs-1.1.3.tar.gz | 39.4 kB | Without provenance | Details for pywhdfs-1.1.3.tar.gz |
Release files / pywhdfs-1.1.3.tar.gz
| Download URL | pywhdfs-1.1.3.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e7004ee85f5163832277dc91638a68435c5b1da672125c728f3209b98156968
|
|
BLAKE2b-256 checksum How to use checksums |
0eac85aa2039a335cc6ecea067fd29510f64cd10c9f0f1c2df8a00b8c7ba9cb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.10
|
Security for pywhdfs 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.