用python 3包装的redis数据结构。
redis_structures的Python项目详细描述
用python 3包装的redis数据结构。
Full documentation can be found at http://docr.it/redis_structures
安装
redis_结构需要运行的redis服务器。有关安装说明,请参见Redis’s quickstart。
安装redis_结构:
$ sudo pip install redis_structures
或来源:
$ git clone https://github.com/jaredlunde/redis_structures
$ cd redis_structures
$ sudo python setup.py install
开始
>>> fromredis_structuresimportStrictRedis,RedisHash>>> client=StrictRedis(host='localhost',port=6379,db=0)>>> rh=RedisHash("my_hash",prefix="rs:hash"client=client)>>> rh['hello']="world"# sets the field name 'hello' to value 'world' in>>> # redis under the key rs:hash:my_hash>>> rh['hello']'world' >>> delrh['hello']>>> rh.get('hello')None