skip to navigation
skip to content

Not Logged In

redis_wrap 1.4.2

Implements a wrapper for Redis datatypes so they mimic the datatypes found in Python.

redis_wrap

Implements a wrapper for Redis datatypes so they mimic the datatypes found in Python.

Requires Redis 2.0+ and newest version of redis-py.

For best performance the wrappers are lazy and use direct Redis calls. E.g. __len__ of list wrapper is implemented by calling llen.

redis-py can be downloaded from here: * http://github.com/andymccurdy/redis-py

Examples

Example of list wrapper:

bears = get_list('bears')
bears.append('grizzly')
assert len(bears) == 1
assert 'grizzly' in bears

Example of hash wrapper:

villains = get_hash('villains')
assert 'riddler' not in villains

villains['riddler'] = 'Edward Nigma'
assert 'riddler' in villains

assert len(villains.keys()) == 1

del villains['riddler']
assert len(villains) == 0

Example of set wrapper:

fishes = get_set('fishes')
assert 'nemo' not in fishes

fishes.add('nemo')
assert 'nemo' in fishes

for item in fishes:
    assert item == 'nemo'

Copyright: 2010 by amix License: BSD.

 
File Type Py Version Uploaded on Size
redis_wrap-1.4.2-py2.7.egg (md5) Python Egg 2.7 2013-03-07 6KB
redis_wrap-1.4.2.tar.gz (md5) Source 2013-03-07 2KB
  • Downloads (All Versions):
  • 75 downloads in the last day
  • 323 downloads in the last week
  • 1097 downloads in the last month