Skip to main content

UnQLite Binding for Python

Project description


UnQLite for Python Binding

## Install

> sudo pip install unqlitepy
Successfully installed UnQLitePy
Cleaning up...

> virtualenv sample
> cd sample
> bin/pip install git+
Successfully installed UnQLitePy
Cleaning up...

## Usage

from unqlitepy import UnQLite

with UnQLite(':mem:') as db:'test', 'hello!')
print db.fetch('test') # -> hello!
db.append('test', ' world!')
print db.fetch('test') # -> hello! world!

for i in range(25):'test{0}'.format(i), 'hello!')'etst{0}'.format(i), 'hello!')
if i%5==0:

def f(output, outlen, udata):
output = (c_char*outlen).from_address(output).raw
print locals()

db.fetch_cb('test0', f)

sample = (
"print 'hello!\n';"
"db_create('users'); /* Create the collection users */"
" /* Store something */ "
"db_store('users',{ 'name' : 'dean' , 'age' : 32 });"
"db_store('hoges',{ 'name' : 'dean' , 'age' : 32 });"
"db_store('users',{ 'name' : 'chems' , 'age' : 27 });"
"db_store('hoges',{ 'name' : 'chems' , 'age' : 27 });"
"print db_fetch_all('users')..'\n';"
"/*print db_reset_record_cursor('users')..'\n';*/"
"while( ($rec = db_fetch('users')) != NULL ){"
" print $rec; print '\n';"

with db.compile(sample) as vm:
with vm.new_scalar() as sv, vm.new_array() as av:
print sv, sv.is_scalar()
print av, av.is_json_array()

db.fetch_cb('users', f)

with db.cursor() as cursor:
while cursor.valid():
print repr(cursor.key()), repr(cursor.value())

Project details

Release history Release notifications

This version


Download files

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

Files for unqlitepy, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size unqlitepy-0.3.0.tar.gz (417.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page