Skip to content

guokr/redis-namespace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-namespace

Build Status PyPi Version

redis-namespace for python

Redis namespace provides an interface to a namespaced subset of your redis keyspace (e.g., keys with a common beginning), and requires the redis-py.

import redis
from redis_namespace import StrictRedis

redis_connection = redis.StrictRedis()
namespaced_redis = StrictRedis(namespace='ns:')
namespaced_redis.set('foo', 'bar')  # redis_connection.set('ns:foo', 'bar')

namespaced_redis.get('foo')
redis_connection.get('ns:foo')

namespaced_redis.delete('foo')
namespaced_redis.get('foo')
redis_connection.get('ns:foo')

Installation

pip install redis-namespace

Warning: The redis-py's version must match redis-namespace's

Supported list

redis-py redis-namespace
3.0.1 3.0.1.1
2.10.6 2.10.6.1
2.10.5 2.10.5.2
2.10.3 2.10.3.1