Python/Python3 library to interact with Apache HBase,support HBase 2.0, time-range scan and HBase thrift 2 procotol.
Project description
EasyBase
EasyBase is a developer-friendly Python library to interact with Apache HBase . The original source code forked from HappyBase.
Feature highlight
easy using
support HBase Thrift 2 protocol(HBase Thrift 1 is NO longer supported)
using thriftpy2 instead of old thriftpy
Installation
pip install easybase
Usage
Connect
import easybase
host, port = 'localhost', 9000
tbl = 'test1'
conn = easybase.Connection(host=host, port=port)
table = conn.table(tbl)
rs = conn.scan(limit=10)
for row in rs:
print(row)
Create Table
table_def = {'cf1':dict(),
'cf2':{'max_versions':2000}}
conn.create_table('test1', table_def)
Write row to table
puts = {'cf1:c1': 'v1',
'cf1:c2': 'v2'
'cf2:c2': 'v3'}
tbl = conn.table('test1')
tbl.put(row='rk1', puts)
Get row from table
rk = 'rk1'
tbl = conn.table('test1')
rs = tbl.row(rk)
Scan rows
tbl = conn.table('test1')
scanner = tbl.scan(row_start='rk_0001', row_stop='rk_0100')
for row in scanner:
print(row)
Get all namespace
for ns in conn.list_namespaces():
print(ns)
You can get detail in DemoClient.py
License
MIT License http://www.opensource.org/licenses/MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easybase-1.1.3.tar.gz.
File metadata
- Download URL: easybase-1.1.3.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f86271e10c58cce994bf94c28bbb9ccab8fd525c70635cbe1c87c5b90765461d
|
|
| MD5 |
cfb4f41205d5bb3671d586b0fd7a6879
|
|
| BLAKE2b-256 |
7c5116556726d60251aaea9213078f3dfed7df632242282030b40036a39dd88f
|
File details
Details for the file easybase-1.1.3-py2.py3-none-any.whl.
File metadata
- Download URL: easybase-1.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 31.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7123222a8d73eb31dd112e870f85d0c4d78b3989ca816c69df73296ff644e78e
|
|
| MD5 |
59c9eeed8d072c73a381664a26b4bee9
|
|
| BLAKE2b-256 |
65e28bc5153dd975b1e6562d5a770fccb966e2ee2e3db217950e3987e7068084
|