An in-process implementation of Redis written in Python
ZSets are a Python datastructure for sorted sets.
Optionally you can use blist for better perfomance.
Examples:
>>> zset = ZSet()
>>> zset.zadd(a=9, b=7, c=5, d=3, e=1)
>>> print zset.zrange(1, 3, withscores=True, score_cast_func=int)
[('d', 3), ('c', 5), ('b', 7)])
Hash datastructures are basically python dictionaries with the redis api
Examples:
>>> h = Hash()
>>> h.hmset({'a': 'aa', 'b': 'bb', 'c': 'cc'})
>>> h.hmget(['c', 'b'])
['cc', 'bb']
Set datastructure are basically python sets with the redis api
Examples:
>>> s = Set()
>>> s.sadd('a', 'b', 'c')
>>> s.smembers()
['a', 'b', 'c']