wrongwaycn / ssdb-py Goto Github PK
View Code? Open in Web Editor NEWSSDB Python Client like Redis-Py
Home Page: http://ssdb-py.readthedocs.org/
License: BSD 2-Clause "Simplified" License
SSDB Python Client like Redis-Py
Home Page: http://ssdb-py.readthedocs.org/
License: BSD 2-Clause "Simplified" License
url:https://github.com/wrongwaycn/ssdb-py
在Getting Started中:
ssdb.multi_hset('hash_2',
... key1=42,
... key2=3.1415926,
... key3=-1.41421,
... key4=256,
... key5='e',
... key6='log'
... )ssdb.hdecr('hash_2', 'key1', 7)
36
这个操作是不是42-7=35,不知道为什么结果是36.
使用ttl方法是报错:
File "C:\Python27\lib\site-packages\ssdb\client.py", line 398, in ttl
if isinstance(time, datetime.timedelta):
UnboundLocalError: local variable 'time' referenced before assignment
def ttl(self, name):
"""
Returns the number of seconds until the key ``name`` will expire.
Like **Redis.TTL**
.. note:: ``ttl`` **can only** be used to the `Key/Value`_ .
:param string name: the key name
:return: the number of seconds, or ``-1`` if the key doesn't
exist or have no ttl
:rtype: int
>>> ssdb.ttl('set_abc')
6
>>> ssdb.ttl('not_exist')
-1
"""
if isinstance(time, datetime.timedelta):
time = time.seconds + time.days * 24 * 3600
return self.execute_command('expire', name, ttl)
函数里面用了一个名为time的对象,但是没有初始化
你好,ssdbcli 是可以进行 hset的key 更新 value的操作。
ssdb.hset("hash_3", 'yellow', '#FFFF00')
True
ssdb.hset("hash_3", 'yellow', '#FFFF00')
True
但是在python 客户端中无法进行修改哦。
ssdb.hset("hash_3", 'yellow', '#FFFF00')
True
ssdb.hset("hash_3", 'yellow', '#FFFF00')
False
另外,ssdb 支持Queue OPERATION 了。这个也可以增加支持吗? 谢谢!
have fixed. and I will give my commits this weekend.
对相同的name key 设置返回False,但实际已经设置成功
>>> db.zincr('test', 'a', 1)
3
>>> db.zincr('test', 'a', 1)
4
>>> db.zset('test', 'a', 6)
False
>>> db.zdel('test', 'a')
True
>>> db.zset('test', 'a', 6)
True
>>> db.zset('test', 'a', 9)
False
>>> db.zincr('test', 'a', 1)
10
>>> db.zset('test', 'a', 99)
False
>>> db.zget('test', 'a')
99
>>>
File "setup.py", line 5, in
from ssdb import version
File "/ssdb-py/ssdb/init.py", line 2, in
from ssdb.client import StrictSSDB, SSDB
File "/ssdb-py/ssdb/client.py", line 74
return {k:int(v) for k,v in list_to_dict(lst).items()}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.