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
def rocon_python_redis.client.StrictRedis.__init__ | ( | self, | |
host = 'localhost' , |
|||
port = 6379 , |
|||
db = 0 , |
|||
password = None , |
|||
socket_timeout = None , |
|||
connection_pool = None , |
|||
charset = 'utf-8' , |
|||
errors = 'strict' , |
|||
decode_responses = False , |
|||
unix_socket_path = None |
|||
) |
def rocon_python_redis.client.StrictRedis.__getitem__ | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis._zaggregate | ( | self, | |
command, | |||
dest, | |||
keys, | |||
aggregate = None |
|||
) | [private] |
def rocon_python_redis.client.StrictRedis.append | ( | self, | |
key, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.bgsave | ( | self | ) |
def rocon_python_redis.client.StrictRedis.bitcount | ( | self, | |
key, | |||
start = None , |
|||
end = None |
|||
) |
def rocon_python_redis.client.StrictRedis.bitop | ( | self, | |
operation, | |||
dest, | |||
keys | |||
) |
def rocon_python_redis.client.StrictRedis.blpop | ( | self, | |
keys, | |||
timeout = 0 |
|||
) |
LIST COMMANDS ####.
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.
def rocon_python_redis.client.StrictRedis.brpop | ( | self, | |
keys, | |||
timeout = 0 |
|||
) |
def rocon_python_redis.client.StrictRedis.brpoplpush | ( | self, | |
src, | |||
dst, | |||
timeout = 0 |
|||
) |
def rocon_python_redis.client.StrictRedis.config_get | ( | self, | |
pattern = "*" |
|||
) |
def rocon_python_redis.client.StrictRedis.config_set | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.dbsize | ( | self | ) |
def rocon_python_redis.client.StrictRedis.debug_object | ( | self, | |
key | |||
) |
def rocon_python_redis.client.StrictRedis.decr | ( | self, | |
name, | |||
amount = 1 |
|||
) |
def rocon_python_redis.client.StrictRedis.delete | ( | self, | |
names | |||
) |
def rocon_python_redis.client.StrictRedis.echo | ( | self, | |
value | |||
) |
def rocon_python_redis.client.StrictRedis.eval | ( | self, | |
script, | |||
numkeys, | |||
keys_and_args | |||
) |
Execute the LUA ``script``, specifying the ``numkeys`` the script will touch and the key names and argument values in ``keys_and_args``. Returns the result of the script. In practice, use the object returned by ``register_script``. This function exists purely for Redis API completion.
def rocon_python_redis.client.StrictRedis.evalsha | ( | self, | |
sha, | |||
numkeys, | |||
keys_and_args | |||
) |
Use the ``sha`` to execute a LUA script already registered via EVAL or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the key names and argument values in ``keys_and_args``. Returns the result of the script. In practice, use the object returned by ``register_script``. This function exists purely for Redis API completion.
def rocon_python_redis.client.StrictRedis.execute_command | ( | self, | |
args, | |||
options | |||
) |
def rocon_python_redis.client.StrictRedis.exists | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.expire | ( | self, | |
name, | |||
time | |||
) |
def rocon_python_redis.client.StrictRedis.expireat | ( | self, | |
name, | |||
when | |||
) |
def rocon_python_redis.client.StrictRedis.flushall | ( | self | ) |
def rocon_python_redis.client.StrictRedis.flushdb | ( | self | ) |
def rocon_python_redis.client.StrictRedis.from_url | ( | cls, | |
url, | |||
db = None , |
|||
kwargs | |||
) |
Return a Redis client object configured from the given URL. For example:: redis://username:password@localhost:6379/0 If ``db`` is None, this method will attempt to extract the database ID from the URL path component. Any additional keyword arguments will be passed along to the Redis class's initializer.
def rocon_python_redis.client.StrictRedis.get | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.getbit | ( | self, | |
name, | |||
offset | |||
) |
def rocon_python_redis.client.StrictRedis.getrange | ( | self, | |
key, | |||
start, | |||
end | |||
) |
def rocon_python_redis.client.StrictRedis.getset | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.hdel | ( | self, | |
name, | |||
keys | |||
) |
def rocon_python_redis.client.StrictRedis.hexists | ( | self, | |
name, | |||
key | |||
) |
def rocon_python_redis.client.StrictRedis.hget | ( | self, | |
name, | |||
key | |||
) |
def rocon_python_redis.client.StrictRedis.hgetall | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.hincrby | ( | self, | |
name, | |||
key, | |||
amount = 1 |
|||
) |
def rocon_python_redis.client.StrictRedis.hkeys | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.hlen | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.hmget | ( | self, | |
name, | |||
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.hmset | ( | self, | |
name, | |||
mapping | |||
) |
def rocon_python_redis.client.StrictRedis.hset | ( | self, | |
name, | |||
key, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.hsetnx | ( | self, | |
name, | |||
key, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.hvals | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.incr | ( | self, | |
name, | |||
amount = 1 |
|||
) |
def rocon_python_redis.client.StrictRedis.info | ( | self | ) |
def rocon_python_redis.client.StrictRedis.keys | ( | self, | |
pattern = '*' |
|||
) |
def rocon_python_redis.client.StrictRedis.lastsave | ( | self | ) |
def rocon_python_redis.client.StrictRedis.lindex | ( | self, | |
name, | |||
index | |||
) |
def rocon_python_redis.client.StrictRedis.linsert | ( | self, | |
name, | |||
where, | |||
refvalue, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.llen | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.lock | ( | self, | |
name, | |||
timeout = None , |
|||
sleep = 0.1 |
|||
) |
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.
def rocon_python_redis.client.StrictRedis.lpop | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.lpush | ( | self, | |
name, | |||
values | |||
) |
def rocon_python_redis.client.StrictRedis.lpushx | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.lrange | ( | self, | |
name, | |||
start, | |||
end | |||
) |
def rocon_python_redis.client.StrictRedis.lrem | ( | self, | |
name, | |||
count, | |||
value | |||
) |
Remove the first ``count`` occurrences of elements equal to ``value`` from the list stored at ``name``. The count argument influences the operation in the following ways: count > 0: Remove elements equal to value moving from head to tail. count < 0: Remove elements equal to value moving from tail to head. count = 0: Remove all elements equal to value.
Reimplemented in rocon_python_redis.client.Redis.
def rocon_python_redis.client.StrictRedis.lset | ( | self, | |
name, | |||
index, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.ltrim | ( | self, | |
name, | |||
start, | |||
end | |||
) |
def rocon_python_redis.client.StrictRedis.mget | ( | self, | |
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.move | ( | self, | |
name, | |||
db | |||
) |
def rocon_python_redis.client.StrictRedis.mset | ( | self, | |
mapping | |||
) |
def rocon_python_redis.client.StrictRedis.msetnx | ( | self, | |
mapping | |||
) |
def rocon_python_redis.client.StrictRedis.object | ( | self, | |
infotype, | |||
key | |||
) |
def rocon_python_redis.client.StrictRedis.parse_response | ( | self, | |
connection, | |||
command_name, | |||
options | |||
) |
def rocon_python_redis.client.StrictRedis.persist | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.ping | ( | self | ) |
def rocon_python_redis.client.StrictRedis.pipeline | ( | self, | |
transaction = True , |
|||
shard_hint = None |
|||
) |
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.
Reimplemented in rocon_python_redis.client.Redis.
def rocon_python_redis.client.StrictRedis.publish | ( | self, | |
channel, | |||
message | |||
) |
def rocon_python_redis.client.StrictRedis.pubsub | ( | self, | |
shard_hint = None |
|||
) |
def rocon_python_redis.client.StrictRedis.randomkey | ( | self | ) |
def rocon_python_redis.client.StrictRedis.register_script | ( | self, | |
script | |||
) |
def rocon_python_redis.client.StrictRedis.rename | ( | self, | |
src, | |||
dst | |||
) |
def rocon_python_redis.client.StrictRedis.renamenx | ( | self, | |
src, | |||
dst | |||
) |
def rocon_python_redis.client.StrictRedis.rpop | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.rpoplpush | ( | self, | |
src, | |||
dst | |||
) |
def rocon_python_redis.client.StrictRedis.rpush | ( | self, | |
name, | |||
values | |||
) |
def rocon_python_redis.client.StrictRedis.rpushx | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.sadd | ( | self, | |
name, | |||
values | |||
) |
def rocon_python_redis.client.StrictRedis.save | ( | self | ) |
def rocon_python_redis.client.StrictRedis.scard | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.script_exists | ( | self, | |
args | |||
) |
def rocon_python_redis.client.StrictRedis.script_load | ( | self, | |
script | |||
) |
def rocon_python_redis.client.StrictRedis.sdiff | ( | self, | |
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.sdiffstore | ( | self, | |
dest, | |||
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.set | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.set_response_callback | ( | self, | |
command, | |||
callback | |||
) |
def rocon_python_redis.client.StrictRedis.setbit | ( | self, | |
name, | |||
offset, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.setex | ( | self, | |
name, | |||
time, | |||
value | |||
) |
Set the value of key ``name`` to ``value`` that expires in ``time`` seconds. ``time`` can be represented by an integer or a Python timedelta object.
Reimplemented in rocon_python_redis.client.Redis.
def rocon_python_redis.client.StrictRedis.setnx | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.setrange | ( | self, | |
name, | |||
offset, | |||
value | |||
) |
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.
def rocon_python_redis.client.StrictRedis.shutdown | ( | self | ) |
def rocon_python_redis.client.StrictRedis.sinter | ( | self, | |
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.sinterstore | ( | self, | |
dest, | |||
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.sismember | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.slaveof | ( | self, | |
host = None , |
|||
port = None |
|||
) |
def rocon_python_redis.client.StrictRedis.smembers | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.smove | ( | self, | |
src, | |||
dst, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.sort | ( | self, | |
name, | |||
start = None , |
|||
num = None , |
|||
by = None , |
|||
get = None , |
|||
desc = False , |
|||
alpha = False , |
|||
store = None |
|||
) |
Sort and return the list, set or sorted set at ``name``. ``start`` and ``num`` allow for paging through the sorted data ``by`` allows using an external key to weight and sort the items. Use an "*" to indicate where in the key the item value is located ``get`` allows for returning items from external keys rather than the sorted data itself. Use an "*" to indicate where int he key the item value is located ``desc`` allows for reversing the sort ``alpha`` allows for sorting lexicographically rather than numerically ``store`` allows for storing the result of the sort into the key ``store``
def rocon_python_redis.client.StrictRedis.spop | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.srandmember | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.srem | ( | self, | |
name, | |||
values | |||
) |
def rocon_python_redis.client.StrictRedis.strlen | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.substr | ( | self, | |
name, | |||
start, | |||
end = -1 |
|||
) |
def rocon_python_redis.client.StrictRedis.sunion | ( | self, | |
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.sunionstore | ( | self, | |
dest, | |||
keys, | |||
args | |||
) |
def rocon_python_redis.client.StrictRedis.time | ( | self | ) |
def rocon_python_redis.client.StrictRedis.transaction | ( | self, | |
func, | |||
watches, | |||
kwargs | |||
) |
def rocon_python_redis.client.StrictRedis.ttl | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.type | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.unwatch | ( | self | ) |
def rocon_python_redis.client.StrictRedis.watch | ( | self, | |
names | |||
) |
def rocon_python_redis.client.StrictRedis.zadd | ( | self, | |
name, | |||
args, | |||
kwargs | |||
) |
SORTED SET COMMANDS ####.
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)
Reimplemented in rocon_python_redis.client.Redis.
def rocon_python_redis.client.StrictRedis.zcard | ( | self, | |
name | |||
) |
def rocon_python_redis.client.StrictRedis.zcount | ( | self, | |
name, | |||
min, | |||
max | |||
) |
def rocon_python_redis.client.StrictRedis.zincrby | ( | self, | |
name, | |||
value, | |||
amount = 1 |
|||
) |
def rocon_python_redis.client.StrictRedis.zinterstore | ( | self, | |
dest, | |||
keys, | |||
aggregate = None |
|||
) |
def rocon_python_redis.client.StrictRedis.zrange | ( | self, | |
name, | |||
start, | |||
end, | |||
desc = False , |
|||
withscores = False , |
|||
score_cast_func = float |
|||
) |
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
def rocon_python_redis.client.StrictRedis.zrangebyscore | ( | self, | |
name, | |||
min, | |||
max, | |||
start = None , |
|||
num = None , |
|||
withscores = False , |
|||
score_cast_func = float |
|||
) |
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
def rocon_python_redis.client.StrictRedis.zrank | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.zrem | ( | self, | |
name, | |||
values | |||
) |
def rocon_python_redis.client.StrictRedis.zremrangebyrank | ( | self, | |
name, | |||
min, | |||
max | |||
) |
def rocon_python_redis.client.StrictRedis.zremrangebyscore | ( | self, | |
name, | |||
min, | |||
max | |||
) |
def rocon_python_redis.client.StrictRedis.zrevrange | ( | self, | |
name, | |||
start, | |||
num, | |||
withscores = False , |
|||
score_cast_func = float |
|||
) |
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
def rocon_python_redis.client.StrictRedis.zrevrangebyscore | ( | self, | |
name, | |||
max, | |||
min, | |||
start = None , |
|||
num = None , |
|||
withscores = False , |
|||
score_cast_func = float |
|||
) |
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
def rocon_python_redis.client.StrictRedis.zrevrank | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.zscore | ( | self, | |
name, | |||
value | |||
) |
def rocon_python_redis.client.StrictRedis.zunionstore | ( | self, | |
dest, | |||
keys, | |||
aggregate = None |
|||
) |
rocon_python_redis::client.StrictRedis::__contains__ = exists [static, private] |
rocon_python_redis::client.StrictRedis::__delitem__ = delete [static, private] |
rocon_python_redis::client.StrictRedis::__setitem__ = set [static, private] |
tuple rocon_python_redis::client.StrictRedis::RESPONSE_CALLBACKS [static] |
Reimplemented in rocon_python_redis.client.Redis.