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 orignal source code forked from HappyBase.
Feature highlight
easy using
support HBase Thrift 2 protocol
using thriftpy2 instead of old thriftpy
Installation
pip install easybase
Usage
Connect
import easybase
host, port = 'localhost', 9000
tbl = 'test1'
conn = easybase.connect(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)
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
Close
Hashes for easybase-1.0.2.macosx-10.9-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a00a9ab1f46f4f7b731f600ff86fd2a3da80b46d318fb65671d62d0738c355d0 |
|
MD5 | 7b066b3c5a55bf1e2fd9aa41ac95e003 |
|
BLAKE2b-256 | f33669d87e77401859aacc9fe3a0bce9574e99e23c7f3887271f3bd59270cf92 |
Close
Hashes for easybase-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ae249edb283a7c722f9890c8f5a4c703712ec33110edd0055293d0c9e7cf302 |
|
MD5 | ab99dd961a48a0f617d02b6a2b540b51 |
|
BLAKE2b-256 | 5425ad8bfa04a338885e330a7b794053b3a55e7acb408074b41a8a5bdf14fd44 |