- 浏览: 135449 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
SINCE1978:
还没细看,似乎取材自一本书《scala与clojure设计模式 ...
Scala设计模式 -
HowKeyond:
补充,我代码中监听了session失效事件,并做了重连,但重连 ...
ZK Timeout再讨论 -
HowKeyond:
请问这一般是什么原因引起的呢?怎么解决?我被这个问题困扰几个星 ...
ZK Timeout再讨论 -
chenchao051:
耶 耶 耶 耶 耶 耶 耶 耶 耶 耶 耶 耶 耶 耶 耶 耶 ...
回答一位网友对Scala的提问 -
dogstar:
唉.唉.唉.唉.唉.唉.唉.唉.唉.唉.唉.唉.唉.唉.唉.
回答一位网友对Scala的提问
Indices and tables
Contents:
Provides backwards compatibility with older versions of redis-py that changed arguments to some commands to be more Pythonic, sane, or by accident.
Remove the first num occurrences of elements equal to value from the list stored at name.
Return a new pipeline object that can queue multiple commands for later execution. transaction indicates whether all commands should be executed atomically. Apart from making a group of operations atomic, pipelines are useful for reducing the back-and-forth overhead between the client and server.
Set the value of key name to value that expires in time seconds
NOTE: The order of arguments differs from that of the official ZADD command. For backwards compatability, this method accepts arguments in the form of name1, score1, name2, score2, while the official Redis documents expects score1, name1, score2, name2.
If you’re looking to use the standard syntax, consider using the StrictRedis class. See the API Reference section of the docs for more information.
Set any number of element-name, score pairs to the key name. Pairs can be specified in two ways:
As *args, in the form of: name1, score1, name2, score2, ... or as **kwargs, in the form of: name1=score1, name2=score2, ...
The following example would add four values to the ‘my-key’ key: redis.zadd(‘my-key’, ‘name1’, 1.1, ‘name2’, 2.2, name3=3.3, name4=4.4)
Implementation of the Redis protocol.
This abstract class provides a Python interface to all Redis commands and an implementation of the Redis protocol.
Connection and Pipeline derive from this, implementing how the commands are sent and received to the Redis server
Appends the string value to the value at key. If key doesn’t already exist, create it with a value of value. Returns the new length of the value at key.
Tell the Redis server to rewrite the AOF file from data in memory.
Tell the Redis server to save its data to disk. Unlike save(), this method is asynchronous and returns immediately.
LPOP a value off of the first non-empty list named in the keys list.
If none of the lists in keys has a value to LPOP, then block for timeout seconds, or until a value gets pushed on to one of the lists.
If timeout is 0, then block indefinitely.
RPOP a value off of the first non-empty list named in the keys list.
If none of the lists in keys has a value to LPOP, then block for timeout seconds, or until a value gets pushed on to one of the lists.
If timeout is 0, then block indefinitely.
Pop a value off the tail of src, push it on the head of dst and then return it.
This command blocks until a value is in src or until timeout seconds elapse, whichever is first. A timeout value of 0 blocks forever.
Return a dictionary of configuration based on the pattern
Set config item name with value
Returns the number of keys in the current database
Returns version specific metainformation about a give key
Decrements the value of key by amount. If no key exists, the value will be initialized as 0 - amount
Delete one or more keys specified by names
Echo the string back from the server
Execute a command and return a parsed response
Returns a boolean indicating whether key name exists
Set an expire flag on key name for time seconds
Set an expire flag on key name. when can be represented as an integer indicating unix time or a Python datetime object.
Delete all keys in all databases on the current host
Delete all keys in the current database
Return the value at key name, or None if the key doesn’t exist
Returns a boolean indicating the value of offset in name
Set the value at key name to value if key doesn’t exist Return the value at key name atomically
Delete keys from hash name
Returns a boolean indicating if key exists within hash name
Return the value of key within the hash name
Return a Python dict of the hash’s name/value pairs
Increment the value of key in hash name by amount
Return the list of keys within hash name
Return the number of elements in hash name
Returns a list of values ordered identically to keys
Sets each key in the mapping dict to its corresponding value in the hash name
Set key to value within hash name Returns 1 if HSET created a new field, otherwise 0
Set key to value within hash name if key does not exist. Returns 1 if HSETNX created a field, otherwise 0.
Return the list of values within hash name
Increments the value of key by amount. If no key exists, the value will be initialized as amount
Returns a dictionary containing information about the Redis server
Returns a list of keys matching pattern
Return a Python datetime object representing the last time the Redis database was saved to disk
Return the item from list name at position index
Negative indexes are supported and will return an item at the end of the list
Insert value in list name either immediately before or after [where] refvalue
Returns the new length of the list on success or -1 if refvalue is not in the list.
Return the length of the list name
Return a new Lock object using key name that mimics the behavior of threading.Lock.
If specified, timeout indicates a maximum life for the lock. By default, it will remain locked until release() is called.
sleep indicates the amount of time to sleep per loop iteration when the lock is in blocking mode and another client is currently holding the lock.
Remove and return the first item of the list name
Push values onto the head of the list name
Push value onto the head of the list name if name exists
Return a slice of the list name between position start and end
start and end can be negative numbers just like Python slicing notation
Remove the first count occurrences of elements equal to value from the list stored at name.
Set position of list name to value
Trim the list name, removing all values not within the slice between start and end
start and end can be negative numbers just like Python slicing notation
Returns a list of values ordered identically to keys
Moves the key name to a different Redis database db
Sets each key in the mapping dict to its corresponding value
Sets each key in the mapping dict to its corresponding value if none of the keys are already set
Return the encoding, idletime, or refcount about the key
Parses a response from the Redis server
Removes an expiration on name
Ping the Redis server
Return a new pipeline object that can queue multiple commands for later execution. transaction indicates whether all commands should be executed atomically. Apart from making a group of operations atomic, pipelines are useful for reducing the back-and-forth overhead between the client and server.
Publish message on channel. Returns the number of subscribers the message was delivered to.
Return a Publish/Subscribe object. With this object, you can subscribe to channels and listen for messages that get published to them.
Returns the name of a random key
Rename key src to dst
Rename key src to dst if dst doesn’t already exist
Remove and return the last item of the list name
RPOP a value off of the src list and atomically LPUSH it on to the dst list. Returns the value.
Push values onto the tail of the list name
Push value onto the tail of the list name if name exists
Add value(s) to set name
Tell the Redis server to save its data to disk, blocking until the save is complete
Return the number of elements in set name
Return the difference of sets specified by keys
Store the difference of sets specified by keys into a new set named dest. Returns the number of keys in the new set.
Set the value at key name to value
Set a custom Response Callback
Flag the offset in name as value. Returns a boolean indicating the previous value of offset.
Set the value of key name to value that expires in time seconds
Set the value of key name to value if key doesn’t exist
Overwrite bytes in the value of name starting at offset with value. If offset plus the length of value exceeds the length of the original value, the new value will be larger than before. If offset exceeds the length of the original value, null bytes will be used to pad between the end of the previous value and the start of what’s being injected.
Returns the length of the new string.
Shutdown the server
Return the intersection of sets specified by keys
Store the intersection of sets specified by keys into a new set named dest. Returns the number of keys in the new set.
Return a boolean indicating if value is a member of set name
Set the server to be a replicated slave of the instance identified by the host and port. If called without arguements, the instance is promoted to a master instead.
Return all members of the set name
Move value from set src to set dst atomically
Sort and return the list, set or sorted set at name.
start and num allow for paging through the sorted data
desc allows for reversing the sort
alpha allows for sorting lexicographically rather than numerically
Remove and return a random member of set name
Return a random member of set name
Remove values from set name
Return the number of bytes stored in the value of name
Return a substring of the string at key name. start and end are 0-based integers specifying the portion of the string to return.
Return the union of sets specifiued by keys
Store the union of sets specified by keys into a new set named dest. Returns the number of keys in the new set.
Convenience method for executing the callable func as a transaction while watching all keys specified in watches. The ‘func’ callable should expect a single arguement which is a Pipeline object.
Returns the number of seconds until the key name will expire
Returns the type of key name
Unwatches the value at key name, or None of the key doesn’t exist
Watches the values at keys names, or None if the key doesn’t exist
Set any number of score, element-name pairs to the key name. Pairs can be specified in two ways:
As *args, in the form of: score1, name1, score2, name2, ... or as **kwargs, in the form of: name1=score1, name2=score2, ...
The following example would add four values to the ‘my-key’ key: redis.zadd(‘my-key’, 1.1, ‘name1’, 2.2, ‘name2’, name3=3.3, name4=4.4)
Return the number of elements in the sorted set name
Increment the score of value in sorted set name by amount
Intersect multiple sorted sets specified by keys into a new sorted set, dest. Scores in the destination will be aggregated based on the aggregate, or SUM if none is provided.
Return a range of values from sorted set name between start and end sorted in ascending order.
start and end can be negative, indicating the end of the range.
desc a boolean indicating whether to sort the results descendingly
withscores indicates to return the scores along with the values. The return type is a list of (value, score) pairs
score_cast_func a callable used to cast the score return value
Return a range of values from the sorted set name with scores between min and max.
If start and num are specified, then return a slice of the range.
withscores indicates to return the scores along with the values. The return type is a list of (value, score) pairs
score_cast_func` a callable used to cast the score return value
Returns a 0-based value indicating the rank of value in sorted set name
Remove member values from sorted set name
Remove all elements in the sorted set name with ranks between min and max. Values are 0-based, ordered from smallest score to largest. Values can be negative indicating the highest scores. Returns the number of elements removed
Remove all elements in the sorted set name with scores between min and max. Returns the number of elements removed.
Return a range of values from sorted set name between start and num sorted in descending order.
start and num can be negative, indicating the end of the range.
withscores indicates to return the scores along with the values The return type is a list of (value, score) pairs
score_cast_func a callable used to cast the score return value
Return a range of values from the sorted set name with scores between min and max in descending order.
If start and num are specified, then return a slice of the range.
withscores indicates to return the scores along with the values. The return type is a list of (value, score) pairs
score_cast_func a callable used to cast the score return value
Returns a 0-based value indicating the descending rank of value in sorted set name
Return the score of element value in sorted set name
Union multiple sorted sets specified by keys into a new sorted set, dest. Scores in the destination will be aggregated based on the aggregate, or SUM if none is provided.
Generic connection pool
Disconnects all connections in the pool
Get a connection from the pool
Create a new connection
Releases the connection back to the pool
Manages TCP communication to and from a Redis server
Connects to the Redis server if not already connected
Disconnects from the Redis server
Return a bytestring representation of the value
Initialize the connection, authenticate and select a database
Pack a series of arguments into a value Redis command
Read the response from a previously sent command
Pack and send a command to the Redis server
Send an already packed command to the Redis server
发表评论
-
改变python的默认语言设置
2013-05-17 14:54 1497import sys sys.getdefaulten ... -
MySQLdb用户指南
2013-05-17 09:15 2465原网页被墙,放这里备用。 MySQLdb User's ... -
redis做缓存时的一点优化
2012-12-13 16:35 2574最近集群上有个job,其中需要短时间内频繁访 ... -
redis -- hash_max_zipmap_entries设置过大有问题
2012-11-08 14:00 4292使用redis时为了使用hash追求更高的内存使用率,我们一般 ... -
记录自己写的简单代码,大家请无视。
2012-10-18 16:40 0采用CMS+PARNEW的时候的,看看哪行的parnew时间较 ... -
python 集合排序 sorted 函数
2012-09-13 17:02 5462Python使用sorted函数来排序: l = [2 ... -
基于stream的mr程序可能出现的异常(不断更新)
2012-09-11 10:02 1662运行: Jar_path=/home/ppstat/hado ... -
Thrift安装中出现的问题(For HBase)
2012-09-06 10:55 1837安装巨简单: 进入thrif ... -
Redis性能问题和解决方案
2012-09-01 16:56 17261.Master写内存快照,save命令调度rdbSave函数 ...
相关推荐
redis-py需要运行中的Redis服务器。 有关安装说明,请参见。 要安装redis-py,只需: $ sudo pip install redis 或者(您确实应该使用点子): $ sudo easy_install redis 或从来源: $ sudo python setup.py ...
fakeredis:redis-py的伪造版本 fakeredis是redis-py python客户端的纯Python实现,可模拟与redis服务器的通话。 创建此文件的目的仅在于:编写unittests 。 设置redis并不困难,但是很多时候您都想编写不与外部...
主要介绍了Redis的Python客户端redis-py安装使用说明文档,本文讲解了安装方法、入门使用实例、API参考和详细说明,需要的朋友可以参考下
RedisJSON Python客户端 rejson-py是一个软件包,该软件包允许在数据库(通过扩展)对象作为JSON文档存储,更新和查询。 该软件包使用ReJSON的API扩展了的接口,并执行对象到JSON的动态序列化/反序列化。安装$ pip ...
python库。 资源全名:redis_websocket_api-0.0.2.post2-py3-none-any.whl
- 以Key对象为单位操作Redis的数据结构 - 提供一组Pythonic的API - 提供方便的类型转换机制 需求 ==== Python2.7Redis2.2redis-py2.4.9 安装 $ cd /tmp/ $ git clone git://github....
如果有勾选sqlmap api scan选项,请在服务器上开启sqlmap api。 一切正常的话你就可以在8000端口上访问到 GourdScanV2 的 web 界面了 Start Monitor 中提供了三种代理方式,区别的话在下方文档有
aredis 是一款基于 Python 3.5 及以上的 redis ...aredis 的优势在于其 api 部分沿袭了 redis-py 的 api 设计,迁移代码非常方便。并且其效率相较于既有的异步 redis-client 也有其优势。 标签:aredis redis
读我r5d4 是一个用 Python 编写的分析引擎,使用 Redis 数据...先决条件核redis - sudo apt-get install redis-server 烧瓶 - sudo easy_install flask redis-py - sudo easy_install redis可选的redis >=2.2 - 用于
带有Python Flask,SQLAlchemy,Celery和Redis的Restful API示例 系统要求 Redis server, Python3.7, pip package installer 1.安装软件包 pip install --upgrade -r requirements.txt 2.创建迁移文件和表 - python...
1、Redis API 1.安装redis模块 $ pip3.8 install redis 2.使用redis模块 import redis # 连接redis的ip地址/主机名,port,password=None r = redis.Redis(host="127.0.0.1",port=6379,password="gs123456") 3....
mark_button: ACL支持 :check_mark_button: 流支持 :check_mark_button: Redis集群支持 :prohibited: 经过测试的Python版本3.6、3.7、3.8、3.9 经过Redis服务器测试5.0、6.0 支持dev Redis服务器通过低级API安装安装...
将您的Binary Edge api密钥粘贴到config.json中 粘贴您的Gmail电子邮件和密码,以防您想使用监控功能 python3 manage.py makemigrations python3 manage.py migrate python3 manage.py runserver 无新窗口启动redis ...
1.先启动 redis-server,为了安全起见,只对 127.0.0.1 开放 2.启动 initial.py 程序,开启 Flask 应用封装 Ansib
Django_Redis 该存储库包含此的代码。...在django_redis_demo/settings.py配置Redis配置 启动Django API $ python manage.py runserver 发送请求到http://localhost:8000/api/items 贡献 请随时使用此提
请求服务需要启动下面的命令`rasa run --enable-api --cors * 5005` 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、...
入门在开始之前,您必须在新选项卡中启动redis服务器redis-server 然后使用python manage.py runserver运行项目$(in a new tab) redis-server$(in main tab) python manage.py runserver个人资料标签个人资料信息...
redis-server /usr/local/etc/redis.conf 安装依赖库 cd MXProxyPool pip install -r requirements.txt 修改配置 settings.py存放了配置信息 运行代理池 cd MXProxyPool python3 run.py api接口 # 随机获取一个代理 ...