Skip to content

Commit

Permalink
upgrade to major version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wgzhao committed Sep 11, 2019
1 parent 877da45 commit 136f449
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 10 deletions.
89 changes: 80 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,90 @@
EasyBase
========

**HappyBase** is a developer-friendly Python library to interact with
Apache HBase. But it not support Thrift 2 protocol. So I fork it and try
to support Thrift 2 and name to **EasyBase**
**EasyBase** is a developer-friendly Python library to interact with
`Apache HBase <https://hbase.apache.org>`__ . The orignal source code
forked from `HappyBase <https://github.com/wbolster/happybase>`__.


Feature highlight
=================

- easy using

- support HBase Thrift 2 protocol

- using `thriftpy2 <http://github.com/thriftpy/thriftpy2>`__ instead of
old thriftpy

HBase thrift 2 cut all DDL schema and merge almost row manipulation. It
mainly support put,get and scan function.

Installation
============

.. code:: shell
pip install easybase
Usage
=====


Connect
-------

.. code:: python
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
------------

``pip install easybase``
.. code:: python
table_def = {'cf1':dict(),
'cf2':{'max_versions':2000}}
conn.create_table('test1', table_def)
Write row to table
------------------

.. code:: python
puts = {'cf1:c1': 'v1',
'cf1:c2': 'v2'
'cf2:c2': 'v3'}
tbl = conn.table('test1')
tbl.put(row='rk1', puts)
Get row from table
------------------

.. code:: python
rk = 'rk1'
tbl = conn.table('test1')
rs = tbl.row(rk)
Scan rows
----------

.. code:: python
Demo
----
tbl = conn.table('test1')
scanner = tbl.scan(row_start='rk_0001', row_stop='rk_0100')
for row in scanner:
print(row)
you can view ``DemoClient.py`` to get detail.
You can get detail in
`DemoClient.py <https://github.com/wgzhao/easybase/blob/master/DemoClient.py>`__
2 changes: 1 addition & 1 deletion easybase/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
setup.py.
"""

__version__ = '0.6'
__version__ = '1.0'

0 comments on commit 136f449

Please sign in to comment.