Skip to main content

No project description provided

Project description

hbase-driver

Native Hbase driver in Python. (No thrift)

Introduction

  • written in pure Python
  • native HBase protocol support (HBase 2.X+)
  • Support both admin operations and regionserver calls.

Installation (pip)

pip3 install hbase-driver

Get Started

from hbasedriver.client import Client
from hbasedriver.operations import Put, Get, Scan
from hbasedriver.exceptions.RemoteException import TableExistsException

# lets say your hbase instance runs on 127.0.0.1 (zk quorum address)
client = Client(["127.0.0.1"])
try:
    client.create_table("", "mytable", ['cf1', 'cf2'])
except TableExistsException:
    pass
table = client.get_table("", "mytable")
table.put(Put(b'row1').add_column(b'cf1', b'qf', b'666'))
table.put(Put(b'row1').add_column(b'cf1', b'qf2', b'999'))
table.put(Put(b'row1').add_column(b'cf2', b'qf', b'777'))
table.put(Put(b'row2').add_column(b'cf1', b'qf123', b'777'))
result = table.get(Get(b"row1").add_column(b'cf1', b'qf'))
print("get result =", result)
assert b'666' == result.get(b'cf1', b'qf')

scan_result = table.scan(Scan(b"row1").add_family(b'cf1'))
# retrieve all results from the iterator.
scan_result = list(scan_result)
print("scan result below:")
for row in scan_result:
    print(row)

Implemented

  • Create, Disable, Delete table
  • Put
  • Get
  • DELETE
  • Scan

TODOs

  • Filters
  • More params in the operations.

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

hbase-driver-0.0.11.tar.gz (100.5 kB view details)

Uploaded Source

Built Distribution

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

hbase_driver-0.0.11-py3-none-any.whl (147.3 kB view details)

Uploaded Python 3

File details

Details for the file hbase-driver-0.0.11.tar.gz.

File metadata

  • Download URL: hbase-driver-0.0.11.tar.gz
  • Upload date:
  • Size: 100.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for hbase-driver-0.0.11.tar.gz
Algorithm Hash digest
SHA256 708c3e926d6d62b67df7a03bf6807b29f3fdd6eb83230a964e99ba7dde23aebb
MD5 e5adbf75ce269863d200a7027ead2739
BLAKE2b-256 cf8e5f0b44e26f6d56a1df887502feb748607e7dc529ab3d9d156dddbd6ae5ce

See more details on using hashes here.

File details

Details for the file hbase_driver-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: hbase_driver-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 147.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for hbase_driver-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 8ec8aa795e829f6f42e447524dd819343acc693e371d8e45b39a1d95a2708d92
MD5 28e019315aebf26502f5d8f9eaaa7411
BLAKE2b-256 9afd1de12bf56f38ac4f31fc12459864e8e87bf20ee4676fd5532d4965f5f52d

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