Sunday, December 09, 2012

Finally a usable Python library for HBase

Finally a usable Python library for HBase: "import happybase

connection = happybase.Connection('localhost')
table = connection.table('my-table')

table.put('row-key', {'family:qual1': 'value1','family:qual2': 'value2'})
row = table.row('row-key')print row['family:qual1']
# prints 'value1'
for key, data in table.rows(['row-key-1', 'row-key-2']):   
    print key, data  # prints row key and data for each row
for key, data in table.scan(row_prefix='row'):   
     print key, data  # prints 'value1' and 'value2'
row = table.delete('row-key')
"

'via Blog this'