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

Uploaded Source

Built Distribution

redis_wrap-1.1-py2.6.egg (6.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for redis_wrap-1.1.tar.gz
Algorithm Hash digest
SHA256 1359403cab5591dc10d28bdb2fb2373f5f47b67eafd714b0cd0c4c35fa33e0bf
MD5 5e7f46738353a51cb3d404de093ffd05
BLAKE2b-256 5b4a360b34346193d89892dac753fc4d69640aecb47b4c625e139cd87798830f

See more details on using hashes here.

Provenance

File details

Details for the file redis_wrap-1.1-py2.6.egg.

File metadata

  • Download URL: redis_wrap-1.1-py2.6.egg
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for redis_wrap-1.1-py2.6.egg
Algorithm Hash digest
SHA256 f25a0b7dc557e5ba46910b3e70ac321c76443080d25fd237a36cb587d46581ed
MD5 a4291a370391f1a0e8b3e1861c2131ce
BLAKE2b-256 d7379ae84f7ffe381019e55ff3d9c2f98a8c5a2d5d8531181583e03b601e2999

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