Skip to main content

Python3 library to interact with Apache HBase,support HBase 2.0, time-range scan and HBase thrift 2 procotol.

Project description

EasyBase

https://github.com/wgzhao/easybase/actions/workflows/python-package.yml/badge.svg https://img.shields.io/pypi/dm/easybase.svg https://img.shields.io/pypi/v/easybase.svg https://img.shields.io/pypi/pyversions/easybase.svg https://img.shields.io/pypi/implementation/easybase.svg

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easybase-2.0.1.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easybase-2.0.1-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file easybase-2.0.1.tar.gz.

File metadata

  • Download URL: easybase-2.0.1.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for easybase-2.0.1.tar.gz
Algorithm Hash digest
SHA256 d1e2d2e5a7899612fd80254f4e77f3003e6cd1dee3dc05a8e87c8d5e6659c87e
MD5 f88a7f0a5ac6cbe7cc5528d4c5de09af
BLAKE2b-256 64b711a8efe28eaa9207d68df8af4579226ab049d59179578270bc32f1c923a0

See more details on using hashes here.

File details

Details for the file easybase-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: easybase-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for easybase-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a70b62453fd4745431c3f2a29f9d3f9c3062eeddd7d3d2e20cd7a308a67b897f
MD5 08fe189c9659510ddf64d37ce5bdc17c
BLAKE2b-256 63f30d01d62827bede310acb6fc17a87ff241324481544d9dcca42e10a6194d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page