首页 > 代码库 > redis client API
redis client API
想知道redis针对各种编程语言推荐的接口API实现,请参考http://redis.io/clients/
选择python语言,则使用https://github.com/andymccurdy/redis-py
Installation
redis-py requires a running Redis server. See Redis‘s quickstart(http://redis.io/topics/quickstart) for installation instructions.
To install redis-py, simply:
$ sudo pip install redis
or alternatively (you really should be using pip though):
$ sudo easy_install redis
or from source:
$ sudo python setup.py install
Getting Started
>>> import redis>>> r = redis.StrictRedis(host=‘localhost‘, port=6379, db=0)>>> r.set(‘foo‘, ‘bar‘)True>>> r.get(‘foo‘)‘bar‘
API Reference
The official Redis command documentation does a great job of explaining each command in detail. redis-py exposes two client classes that implement these commands. The StrictRedis class attempts to adhere to the official command syntax. There are a few exceptions:
redis client API
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。