Skip to main content

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

Project description


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: *


Example of list wrapper:

bears = get_list('bears')
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

assert 'nemo' in fishes

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

Copyright: 2010 by amix License: BSD.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for redis_wrap, version 1.4.5
Filename, size File type Python version Upload date Hashes
Filename, size redis_wrap-1.4.5.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View
Filename, size redis_wrap-1.4.5-py2.7.egg (13.5 kB) File type Egg Python version 2.7 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page