Python client for Cluster of Redis key-value store
Project description
a Python interface to a Cluster of Redis key-value store.
## Travis CI
Currently, rediscluster-py is being tested via travis ci for python version 2.6, 2.7 and 3.2: [![Build Status](https://secure.travis-ci.org/salimane/rediscluster-py.png?branch=master)](http://travis-ci.org/salimane/rediscluster-py)
## Installation
$ sudo pip install rediscluster
or alternatively (you really should be using pip though):
$ sudo easy_install rediscluster
From source:
$ sudo python setup.py install
## Running Tests
$ git clone https://github.com/salimane/rediscluster-py.git $ cd rediscluster-py $ vi tests/config.py $ ./run_tests
## Getting 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'
##Tagged keys
In order to specify your own hash key (so that related keys can all land on a given node), you pass a list where you’d normally pass a scalar. The first element of the list is the key to use for the hash and the second is the real key that should be fetched/modify:
>>> r.get(["userinfo", "foo"])
In that case “userinfo” is the hash key but “foo” is still the name of the key that is fetched from the redis node that “userinfo” hashes to.
## Information
Code: git clone git://github.com/salimane/rediscluster-py.git
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for rediscluster-0.2.1.win32-py3.2.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad095f91c2e332fb92a60b58af390e2c06cd1217a319c41312b7496d9cb8e156 |
|
MD5 | c1a6901a960890d41599b359b09a911f |
|
BLAKE2b-256 | 7fac6c6992b345b13ba5b720667dca2733011ed5d45c657eee4b637b834fcf0d |
Hashes for rediscluster-0.2.1.win32-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cf1c78cce172b58ec469dc1faeb62ca374a7e92d08ca076fa40a33d07d419b8 |
|
MD5 | 57f7c6d47d82425949a528519ca05860 |
|
BLAKE2b-256 | b987e957138cc39de44a35d656df33b1773566c360f278661a98edede46c89e5 |