Hbase REST API client built using uplink
Project description
hbase
Hbase REST API client built using uplink
Main Features
- A transparent and user friendly HBase REST API client
- Easy to extend by subclassing and utilizing uplink's Consumer class
- A great alternative to HBase Thrift client
Installation
$ pip install hbase
---> 100%
Usage
Build an instance to interact with the web service, check out the HBase client reference for a full list of available methods.
from hbase import HBase
hbase = HBase(base_url="http://localhost:8000")
Then, executing an HTTP request is as simply as invoking a method.
# Get all rows using the wildcard, or supply exact row_id for single row
hbase.get_row(table="example_table", row_id="*")
The returned object is a friendly Pydantic model which will automatically decode the response from base64:
CellSet(
Row=[
Row(
key="decoded_key",
Cell=[
Cell(
column="decoded_column",
timestamp=39082034,
value="decoded_value"
),
...
]
),
...]
)
Similarly you can perform other CRUD operations on HBase, such as inserting a row, note that the data will automatically be encoded into base64 for you free of charge!
hbase.insert_rows(
test_table_name,
rows={
"row-1": {
"col1": "dat1",
"col2": "dat2"
},
"row-2": {
"col1": "dat1",
"col2": "dat2"
}
}
)
hbase.insert_row(
test_table_name,
row_id="row-3",
column_data={
"col1": "dat1",
"col2": "dat2"
}
)
For sending non-blocking requests, HBase uses Uplink, which comes with support for aiohttp and twisted.
Credits
- Uplink - A Declarative HTTP Client for Python
- HBase REST API documentation - Used to help build out the package
License
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
Built Distribution
File details
Details for the file hbase-1.0.0.tar.gz
.
File metadata
- Download URL: hbase-1.0.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.6 Linux/5.8.0-1039-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8b9b4fd81c70caa6334570a35f4265a75a7198850a1579939ba7b0e1c8a7900 |
|
MD5 | a4ee4cf735197290aee184d8e9a8f0e3 |
|
BLAKE2b-256 | f813a1b5200f47e25efe81adc326a338725a58b1cd93d0e72bbe255b079e4326 |
File details
Details for the file hbase-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: hbase-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.6 Linux/5.8.0-1039-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21c2b6501dd44c018a6b8b738ae09cd2346f30940c9704784c4f11b124ce0ed8 |
|
MD5 | 6f95d0818147d8213380c434a60db985 |
|
BLAKE2b-256 | e760f133770773d3b14204b065e7af565485d2d5aaacb6ab07125b0338debee0 |