rediscluster-pyA Python client for Cluster of Redis key-value store | |
Download |
rediscluster-py Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Salimane Adjao Moustapha
- Publisher web site:
- http://github.com/salimane/
rediscluster-py Tags
rediscluster-py Description
rediscluster-py is a Python module that acts as a client for the Redis key-value store cluster.rediscluster-py has been tested via travis ci for Python version 2.6, 2.7 and 3.2.Installation sudo pip install redisclusteror alternatively (you really should be using pip though): sudo easy_install redisclusterFrom source: sudo python setup.py installRunning Tests git clone https://github.com/salimane/rediscluster-py.git $ cd rediscluster-py $ vi tests/config.py $ ./run_testsGetting Started >>> import rediscluster >>> cluster = { ... 'nodes' : { ... 'node_1' : {'host' : '127.0.0.1', 'port' : 63791}, ... 'node_2' : {'host' : '127.0.0.1', 'port' : 63792}, ... 'node_5' : {'host' : '127.0.0.1', 'port' : 63795}, ... 'node_6' : {'host' : '127.0.0.1', 'port' : 63796} ... }, ... 'master_of' : { ... 'node_1' : 'node_6', #node_6 slaveof node_1 in redis6.conf ... 'node_2' : 'node_5' #node_5 slaveof node_2 in redis5.conf ... }, ... 'default_node' : 'node_1' ... } >>> r = rediscluster.StrictRedis(cluster=cluster, db=0) >>> r.set('foo', 'bar') True >>> r.get('foo') 'bar'Information- Code: git clone git://github.com/salimane/rediscluster-py.git- Home: http://github.com/salimane/rediscluster-py- Bugs: http://github.com/salimane/rediscluster-py/issuesProduct's homepage
rediscluster-py Related Software