Package: tornado_hbredis
A tornado redis driver ,it’s actually encapsulation  fortornadisQuickstartedstring operationfromtornado_hbredisimportTornadoHBRedisclient=TornadoHBRedis('localhost',6379,autoconnect=True,bytes_decode=False)# params: 'autoconnect' default value is True#         'bytes_decode' default value is False,which means the data from db will be bytes#                if 'bytes_decode' equal to True, which means the data from db will decodedyieldclient.set("name","john")yieldclient.sget("name")# return opertaon resultyieldclient.incrby("age",2)yieldclient.incr("age")yieldclient.decrby("age",2)yieldclient.decr("age")yieldclient.incrbyfloat("key",0.1)# return str result lengthyieldclient.append("name","xxxx")yieldclient.strlen("name")yieldclient.mset({"key1":"val1","key2":"val2"})yieldclient.mget("key1","key2")# or yield client.mget(["key1", "key2"])yieldclient.getbit("key",offset=1)yieldclient.setbit("key",offset=1,1)yieldclient.bitcount("key",0,1)yieldclient.bit_or("key1","key2",resultkey=None)yieldclient.bit_and("key1","key2",resultkey=None)yieldclient.bit_xor("key1","key2",resultkey=None)yieldclient.bit_not("key",resultkey=None)hash operationfromtornado_hbredisimportTornadoHBRedisclient=TornadoHBRedis("localhost",6379)yieldclient.hmset("key",{"field1":"xxxx","field2":21})yieldclient.hmget("key","field1","field2")# or yield client.hmget("key", ["field1", "field2"])yieldclient.hgetall("key")yieldclient.hget("key","field")yieldclient.hdel("key","field1","field2")# or yield client.hdel("key", ["field1", "field2"])yieldclient.hkeys("key")yieldclient.hlen("key")yieldclient.hvals("key")yieldclient.hexists("key","field")yieldclient.hincrby("key","field",20)list operationfromtornado_hbredisimportTornadoHBRedisclient=TornadoHBRedis("localhost",6379)yieldclient.lpush("list1",12,32,32)# or yield client.lpush("list1",[12, 32, 32])yieldclient.rpush("list1","21","43")# or yield client.rpush("list1",["21", "43"])yieldclient.lrange("list1",0,-1)yieldclient.lpop("list1")yieldclient.rpop("list1")yieldclient.llen("list1")yieldclient.lrem("list1",count=3,"marble")yieldclient.lindex("list1",2)yieldclient.lset("list1",2,"hello")yieldclient.ltrim("list1",1,4)yieldclient.linsert("list1","pivot","value",direc="after")yieldclient.linsertafter("list1","pivot","value")yieldclient.linsertbefore("list1","pivot","value")yieldclient.rpoplpush("src_list","dest_list")set operationfromtornado_hbredisimportTornadoHBRedisclient=TornadoHBRedis("localhost",6379)yieldclient.sadd("set1","yyy")# or yield client.sadd("set1", ["xxx","zzz"])yieldclient.srem("set1","yyy")#or  yield client.srem("set1", ["xxx","zzz"])yieldclient.smembers("set1")yieldclient.sismember("set1","xx")yieldclient.sdiff("set1","set2")yieldclient.sinter("set1","set2")yieldclient.sunion("set1","set2")yieldclient.scard("set1")yieldclient.sdiffstore("set3","set1","set2")yieldclient.sunionstore("set4","set1","set2")yieldclient.srandmember("set1",2)yieldclient.smembers("set4")yieldclient.spop("set1")general commandsfromtornado_hbredisimportTornadoHBRedisclient=TornadoHBRedis("localhost",6379)yieldclient.delete("set4")yieldclient.exists("set4")yieldclient.expire("key",40)yieldcleint.expireat("key",123832190)yieldclient.allkeys("*")yieldclient.keytype("set1")yieldclient.ttl("set1")yieldclient.rename("old_kname","newkeyname")yieldclient.renamenx("old_kname","newkeyname")yieldclient.move("key","db_number")yieldclient.persist("key")yieldclient.pexpire("key","millisecond")yieldclient.pexipreat("key","milisecond timestamp")yieldcleint.pttl("key")server commandsfromtornado_hbredisimportTornadoHBRedisclient=TornadoHBRedis("localhost",6379)yieldclient.dbsize()yieldclient.flushall()yieldclient.flushdb()pipelinefromtornado_hbredisimportTornadoHBRedisclient=TornadoHBRedis("localhost",6379)pipeline=client.pipeline()pipeline.set("address","foo")pipeline.hmset("hash",{"name":"john","age":21})pipeline.lpush("xxx",[21,43,43,43,54])yieldpipeline.execute()DetailThe detail api refer tohereLICENSEMIT LICENSE