Implements a wrapper for Redis datatypes so they mimic the datatypes found in Python.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file redis_wrap-1.4.4.tar.gz
.
File metadata
- Download URL: redis_wrap-1.4.4.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56892132490376784e74dec3543c4379aaf51817f2b77763a42ed37a71c64e33 |
|
MD5 | 525a1083f236a6f5ce4fa5b7ac0a868b |
|
BLAKE2b-256 | a39959594c76cda0d10654abc4f395d85697ef9bba533197206d4dbfaaa902af |
Provenance
File details
Details for the file redis_wrap-1.4.4-py2.7.egg
.
File metadata
- Download URL: redis_wrap-1.4.4-py2.7.egg
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2c96322909a0aad6a7860ba4cbcc7889ec12e138eca8ec884a781980ac74b04 |
|
MD5 | c9f0f1cf60da09f84506723707a11a7d |
|
BLAKE2b-256 | badce301b58e3545173208dee49bfbb107741384c7d9a2f9d39638d8d7e511be |