fortianwei / pyssdb

An SSDB Client Library for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyssdb

https://travis-ci.org/ifduyue/pyssdb.png https://badge.fury.io/py/pyssdb.png https://pypip.in/d/pyssdb/badge.png

pyssdb is an SSDB Client Library for Python. SSDB is a high performace key-value(key-string, key-zset, key-hashmap) NoSQL database, using Google LevelDB as storage engine.

  • pyssdb is simple, has no depencencies other than the Python Standard Library.
  • pyssdb is pure Python, and is compatible with gevent.
  • pyssdb is thread-safe.

Installation

$ pip install pyssdb --upgrade

Usage

Here is a short example:

>>> import pyssdb
>>> c = pyssdb.Client()
>>> c.set('key', 'value')
1
>>> c.get('key')
'value'
>>> c.delete('key')
1
>>> c.hset('hash', 'item', 'value')
1
>>> c.hget('hash', 'item')
'value'
>>> c.hget('hash', 'not exist') is None
True
>>> c.incr('counter')
1
>>> c.incr('counter')
2
>>> c.incr('counter')
3
>>> c.keys('a', 'z', 1)
['counter']
>>> c.keys('a', 'z', 10)
['counter', 'key']

As del is a keyword of python, we use delete command instead.

For more information, see the tutorial, which will explain most everything.

For the full list of SSDB commands, see this page.

License

Copyright (C) 2013-2014 Yue Du, Licensed under the 2-clause BSD license.

About

An SSDB Client Library for Python

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 100.0%