Introducing pickleDB; a simple, lightweight, and fast key-value database.
Peter Otten
__peter__ at web.de
Mon Oct 31 04:53:00 EDT 2011
patx wrote:
> Hello I have recently started work on a new project called pickleDB. It is
> a lightweight key-value database engine (inspired by redis).
>
> Check it out at http://packages.python.org/pickleDB
>
> import json as pickle # ;)
>
> def load(location):
> global db
> try:
> db = pickle.load(open(location, 'rb'))
> except IOError:
> db = {}
> global loco
> loco = location
> return True
>
> def set(key, value):
> db[key] = value
> pickle.dump(db, open(loco, 'wb'))
> return True
>
> def get(key):
> return db[key]
Hmm, I don't think that will scale...
More information about the Python-list
mailing list