skip to navigation
skip to content

Not Logged In

leveldb 0.191

Python bindings for leveldb database library

Latest Version: 0.193

Build Instructions

pip install [--user] leveldb

NB If you have issues with this step, please contact Russell (power@cs.nyu.edu). I'm responsible for the PyPi package upload and any resulting errors.

Example Usage

>>> import leveldb
>>> db = leveldb.LevelDB('./db')
>>> db.Put('hello', 'world')
>>> print db.Get('hello')
world
>>> db.Delete('hello')
>>> db.Get('hello')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError
>>> for i in xrange(10):
...   db.Put(str(i), 'string_%s' % i)
...
>>> print list(db.RangeIter(key_from = '2', key_to = '5'))
[('2', 'string_2'), ('3', 'string_3'), ('4', 'string_4'), ('5', 'string_5')]
>>> batch = leveldb.WriteBatch()
>>> for i in xrange(1000):
...   db.Put(str(i), 'string_%s' % i)
...
>>> db.Write(batch, sync = True)
>>>

Author: Arni Mar Jonsson (arnimarj@gmail.com) - http://code.google.com/p/leveldb/

 
File Type Py Version Uploaded on Size
leveldb-0.191.tar.gz (md5) Source 2013-12-11 222KB
  • Downloads (All Versions):
  • 99 downloads in the last day
  • 517 downloads in the last week
  • 2631 downloads in the last month