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.5.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for redis_wrap-1.4.5.tar.gz
Algorithm Hash digest
SHA256 781c3af55075c27bbb068ecf4dd4366d56fcdff0332dc32e402f9ff5282c332c
MD5 02acc2ea7568463e6447b9e7565b4cb1
BLAKE2b-256 d16e0f5e61a4f7e63a799e194d932294f1c573bd91c5da8751f96459f6711ce7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redis_wrap-1.4.5-py2.7.egg
Algorithm Hash digest
SHA256 1b7b7f936e34f3543faf5d663251e2d96642d4d44db1c95dc4cde46b4a49b629
MD5 59cc38c06e97bc8d25eedd1188f68d5b
BLAKE2b-256 70441f9006981a601f538d1870975938155d6ce81cc5846e54c3aba1e7898902

See more details on using hashes here.

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