Skip to main content

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

redis_wrap-1.4.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

redis_wrap-1.4.3-py2.7.egg (13.5 kB view details)

Uploaded Source

File details

Details for the file redis_wrap-1.4.3.tar.gz.

File metadata

  • Download URL: redis_wrap-1.4.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for redis_wrap-1.4.3.tar.gz
Algorithm Hash digest
SHA256 f9eaead580738d1f13134f125d72226279c82206fdce79863a6c0a7ec7d37dbb
MD5 6d12343eb085fbe5edb548f20d249a8c
BLAKE2b-256 201b373789b038f52fcd2b7911a3b54244b4fb64e2bd89ecf560f6073fff9692

See more details on using hashes here.

Provenance

File details

Details for the file redis_wrap-1.4.3-py2.7.egg.

File metadata

File hashes

Hashes for redis_wrap-1.4.3-py2.7.egg
Algorithm Hash digest
SHA256 a99f3ca2a61be10d0eafbcd2a8d8f7bbfcd1762008c0098be1818aa3372e3e52
MD5 eec02e6b57463bfddcd0347f54f2be01
BLAKE2b-256 383c1e03aaea39a94f2432d7d8bf66668d04d912dc48669138986e717c8556d9

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page