HdfsCLI: API and command line interface for HDFS.
Project Links
Meta
Author: Matthieu Monsch
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Programming Language
- Python
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
HdfsCLI

API and command line interface for HDFS.
$ hdfscli --alias=dev
Welcome to the interactive HDFS python shell.
The HDFS client is available as `CLIENT`.
In [1]: CLIENT.list('models/')
Out[1]: ['1.json', '2.json']
In [2]: CLIENT.status('models/2.json')
Out[2]: {
'accessTime': 1439743128690,
'blockSize': 134217728,
'childrenNum': 0,
'fileId': 16389,
'group': 'supergroup',
'length': 48,
'modificationTime': 1439743129392,
'owner': 'drwho',
'pathSuffix': '',
'permission': '755',
'replication': 1,
'storagePolicy': 0,
'type': 'FILE'
}
In [3]: with CLIENT.read('models/2.json', encoding='utf-8') as reader:
...: from json import load
...: model = load(reader)
...:
Features
-
Python 3 bindings for the WebHDFS (and HttpFS) API, supporting both secure and insecure clusters.
-
Command line interface to transfer files and start an interactive client shell, with aliases for convenient namenode URL caching.
-
Additional functionality through optional extensions:
avro, to read and write Avro files directly from HDFS.dataframe, to load and save Pandas dataframes.kerberos, to support Kerberos authenticated clusters.
See the documentation to learn more.
Getting started
$ pip install hdfs
Then hop on over to the quickstart guide. A Conda feedstock is also available.
Testing
HdfsCLI is tested against both WebHDFS and HttpFS. There are two ways
of running tests (see scripts/ for helpers to set up a test HDFS cluster):
$ HDFSCLI_TEST_URL=http://localhost:50070 pytest # Using a namenode's URL.
$ HDFSCLI_TEST_ALIAS=dev pytest # Using an alias.
Contributing
We'd love to hear what you think on the issues page. Pull requests are also most welcome!
2.7.3
Oct 13, 2023
2.7.2
Aug 09, 2023
2.7.1
Aug 08, 2023
2.7.0
Mar 28, 2022
2.6.0
Feb 14, 2021
2.5.8
Jul 03, 2019
2.5.7
Jun 23, 2019
2.5.6
Jun 15, 2019
2.5.5
Jun 14, 2019
2.5.4
Jun 11, 2019
2.5.3
Jun 09, 2019
2.5.2
Apr 30, 2019
2.5.1
Apr 28, 2019
2.5.0
Apr 04, 2019
2.4.0
Apr 01, 2019
2.3.1
Mar 31, 2019
2.3.0
Mar 31, 2019
2.2.2
Dec 11, 2018
2.2.1
Nov 23, 2018
2.2.0
Nov 20, 2018
2.1.0
Sep 08, 2017
2.0.16
Feb 04, 2017
2.0.15
Jan 06, 2017
2.0.14
Jan 06, 2017
2.0.13
Nov 01, 2016
2.0.12
Oct 05, 2016
2.0.11
Sep 16, 2016
2.0.10
Aug 27, 2016
2.0.9
Jun 09, 2016
2.0.8
Jun 02, 2016
2.0.7
May 19, 2016
2.0.6
May 14, 2016
2.0.5
Dec 09, 2015
2.0.4
Oct 27, 2015
2.0.3
Oct 01, 2015
2.0.2
Aug 26, 2015
2.0.1
Aug 25, 2015
2.0.0
Aug 20, 2015
1.4.3
Aug 03, 2015
1.4.2
Jul 31, 2015
1.4.1
Jul 29, 2015
1.4.0
Jul 24, 2015
1.3.0
Jul 22, 2015
1.2.1
Jul 19, 2015
1.2.0
Jul 19, 2015
1.1.4
Jul 17, 2015
1.1.3
Jul 17, 2015
1.1.2
Jul 17, 2015
1.1.1
Jul 10, 2015
1.1.0
Jun 24, 2015
1.0.2
Jun 18, 2015
1.0.1
Jun 18, 2015
1.0.0
May 27, 2015
0.5.3
Apr 23, 2015
0.5.2
Apr 07, 2015
0.5.1
Apr 07, 2015
0.5.0
Mar 03, 2015
0.4.0
Feb 24, 2015
0.3.2
Feb 20, 2015
0.3.1
Nov 19, 2014
0.3.0
Nov 14, 2014
0.2.15
Nov 12, 2014
0.2.14
Oct 31, 2014
0.2.13
Oct 25, 2014
0.2.12
Oct 25, 2014
0.2.11
Oct 14, 2014
0.2.10
Oct 14, 2014
0.2.8
Aug 16, 2014
0.2.7
Aug 07, 2014
0.2.6
Jul 28, 2014
0.2.5
Jul 28, 2014
0.2.4
Jul 28, 2014
0.2.3
Jul 22, 2014
0.2.2
Apr 27, 2014
0.2.1
Apr 27, 2014
0.2.0
Apr 27, 2014
0.1.3
Mar 25, 2014
0.1.1
Mar 25, 2014
0.1.0
Mar 20, 2014
0.0.2
Mar 20, 2014
0.0.1
Mar 18, 2014
Files in release
No dependencies