A developer-friendly Python library to interact with Apache HBase,support thrift2. It's heavily references to happybase. thank Wouter Bolsterlee
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
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
easybase-1.0-x86_64.tar.gz
(124.5 kB
view hashes)
Built Distribution
easybase-1.0-py2.py3-none-any.whl
(63.2 kB
view hashes)
Close
Hashes for easybase-1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce5b574cd01544a53cc47752c322679bb7396444c72b2e09f1a7895bc999f197 |
|
MD5 | 1b97665763744e60bfbb8d6bce47c93d |
|
BLAKE2b-256 | ae389e1515ce72234053175da943b8c7d3dfeded0de55940629aff291faae868 |