OOREDIS
=======

ooredis是一个Redis的Python库，基于redis-py，它主要有以下三个目标：

- 以Key对象为单位操作Redis的数据结构
- 提供一组Pythonic的API
- 提供方便的类型转换机制 


需求
====

Python2.7
Redis2.2
redis-py2.4.9


安装
====

$ sudo pip2 install ooredis
Downloading/unpacking ooredis
Downloading ooredis-1.0.tar.gz
Running setup.py egg_info for package ooredis

Installing collected packages: ooredis
Running setup.py install for ooredis
                
Successfully installed ooredis
Cleaning up...

$ python2
Python 2.7.2 (default, Jun 29 2011, 11:17:09) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ooredis
>>> 


示例
=====

>>> from ooredis import *
>>> dir()
['Counter', 'Dict', 'List', 'Set', 'SingleValue', 'SortedSet', '__builtins__', '__doc__', '__name__', '__package__', 'connect', 'get_client', 'type_case']
>>>
>>> connect(db=1)   
<redis.client.Redis object at 0xb71cae4c>
>>>
>>> project = Dict('ooredis')
>>> project['name'] = 'ooredis'
>>> project['version'] = 1.0
>>> project['author'] = 'huangz'
>>> 
>>> friends = Set('my_friends')
>>> friends.add('marry')
>>> friends.add('jack')
>>> set(friends)
set([u'marry', u'jack'])
>>> 
>>> 


更多
====

关于更多代码示例及说明，请参见以下幻灯：
(推荐翻墙使用google doc观看，因为幻灯在slideshare显示有排版错误)

去slideshare观看: http://www.slideshare.net/iammutex/ooredis-8792195
去google docs观看: http://bit.ly/rbgn3Z


文档
====

(正在编写中，暂不可用)
http://ooredis.readthedocs.org/


测试
====

注意：测试将清空Redis的0号数据库，请谨慎操作。

$ git clone git://github.com/huangz1990/ooredis.git
Cloning into ooredis...
remote: Counting objects: 112, done.
remote: Compressing objects: 100% (81/81), done.
remote: Total 112 (delta 38), reused 102 (delta 28)
Receiving objects: 100% (112/112), 68.03 KiB | 44 KiB/s, done.
Resolving deltas: 100% (38/38), done.
$ cd ooredis/
$ python2 tests/
.............................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 285 tests in 5.707s

OK


许可
=====

你可以在免费且自由的情况下，下载、使用、修改本软件，如果你需要其他许可，请联系作者。


联系方式
========

twitter: @huangz1990
gmail: huangz1990
豆瓣: http://www.douban.com/people/i_m_huangz/
