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.1.tar.gz
(2.1 kB
view details)
File details
Details for the file redis-hash-0.0.1.tar.gz
.
File metadata
- Download URL: redis-hash-0.0.1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8b2103e7d78c819516b05f8d37e03ab2d7fbb4794eb361c9e425d671aaabf96 |
|
MD5 | f09e8c39ff6b529143497f9c8a3c4cd1 |
|
BLAKE2b-256 | b325b1b271469fd637edc1a9f582b4ff72845f42ff353784af1af7ac09583070 |