Skip to main content

Hash interface for redis-py

Project description

Hash interface for redis-py

Installation

pip install redis_hash

Usage

from redis import StrictRedis
from redis_hash import RedisHash

redis_client = StrictRedis(host='localhost', port=6379, db=0)
redis_hash = RedisHash(redis_client, 'hash_name')
redis_hash['foo'] = 'bar'
assert len(redis_hash) == 1
for k, v in redis_hash:
    print(k, v)  # prints: foo bar
redis_hash  # returns b'bar'
list(redis_hash)  # return [(b'foo', b'bar')]
del redis_hash['foo']
assert len(redis_hash) == 0

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-hash-0.0.2.tar.gz (2.2 kB view hashes)

Uploaded Source

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