All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes
redis.client.StrictRedis Class Reference
Inheritance diagram for redis.client.StrictRedis:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __getitem__
def __init__
def append
 BASIC KEY COMMANDS ####.
def bgrewriteaof
 SERVER INFORMATION ####.
def bgsave
def bitcount
def bitop
def blpop
 LIST COMMANDS ####.
def brpop
def brpoplpush
def config_get
def config_set
def dbsize
def debug_object
def decr
def delete
def echo
def eval
def evalsha
def execute_command
 COMMAND EXECUTION AND PROTOCOL PARSING ####.
def exists
def expire
def expireat
def flushall
def flushdb
def from_url
def get
def getbit
def getrange
def getset
def hdel
 HASH COMMANDS ####.
def hexists
def hget
def hgetall
def hincrby
def hkeys
def hlen
def hmget
def hmset
def hset
def hsetnx
def hvals
def incr
def info
def keys
def lastsave
def lindex
def linsert
def llen
def lock
def lpop
def lpush
def lpushx
def lrange
def lrem
def lset
def ltrim
def mget
def move
def mset
def msetnx
def object
def parse_response
def persist
def ping
def pipeline
def publish
def pubsub
def randomkey
def register_script
def rename
def renamenx
def rpop
def rpoplpush
def rpush
def rpushx
def sadd
 SET COMMANDS ####.
def save
def scard
def script_exists
def script_flush
def script_kill
def script_load
def sdiff
def sdiffstore
def set
def set_response_callback
def setbit
def setex
def setnx
def setrange
def shutdown
def sinter
def sinterstore
def sismember
def slaveof
def smembers
def smove
def sort
def spop
def srandmember
def srem
def strlen
def substr
def sunion
def sunionstore
def time
def transaction
def ttl
def type
def unwatch
def watch
def zadd
 SORTED SET COMMANDS ####.
def zcard
def zcount
def zincrby
def zinterstore
def zrange
def zrangebyscore
def zrank
def zrem
def zremrangebyrank
def zremrangebyscore
def zrevrange
def zrevrangebyscore
def zrevrank
def zscore
def zunionstore

Public Attributes

 connection_pool
 response_callbacks

Static Public Attributes

tuple RESPONSE_CALLBACKS

Private Member Functions

def _zaggregate

Static Private Attributes

 __contains__ = exists
 __delitem__ = delete
 __setitem__ = set

Detailed Description

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

Definition at line 159 of file client.py.


Constructor & Destructor Documentation

def 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 
)

Definition at line 251 of file client.py.


Member Function Documentation

def redis.client.StrictRedis.__getitem__ (   self,
  name 
)
Return the value at key ``name``, raises a KeyError if the key
doesn't exist.

Definition at line 530 of file client.py.

def redis.client.StrictRedis._zaggregate (   self,
  command,
  dest,
  keys,
  aggregate = None 
) [private]

Definition at line 1135 of file client.py.

def redis.client.StrictRedis.append (   self,
  key,
  value 
)

BASIC KEY COMMANDS ####.

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``.

Definition at line 459 of file client.py.

SERVER INFORMATION ####.

Definition at line 362 of file client.py.

Tell the Redis server to save its data to disk.  Unlike save(),
this method is asynchronous and returns immediately.

Definition at line 366 of file client.py.

def redis.client.StrictRedis.bitcount (   self,
  key,
  start = None,
  end = None 
)
Returns the count of set bits in the value of ``key``.  Optional
``start`` and ``end`` paramaters indicate which bytes to consider

Definition at line 474 of file client.py.

def redis.client.StrictRedis.bitop (   self,
  operation,
  dest,
  keys 
)
Perform a bitwise operation using ``operation`` between ``keys`` and
store the result in ``dest``.

Definition at line 487 of file client.py.

def 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.

Definition at line 681 of file client.py.

def redis.client.StrictRedis.brpop (   self,
  keys,
  timeout = 0 
)
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.

Definition at line 701 of file client.py.

def redis.client.StrictRedis.brpoplpush (   self,
  src,
  dst,
  timeout = 0 
)
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.

Definition at line 721 of file client.py.

def redis.client.StrictRedis.config_get (   self,
  pattern = "*" 
)

Definition at line 373 of file client.py.

def redis.client.StrictRedis.config_set (   self,
  name,
  value 
)

Definition at line 377 of file client.py.

Definition at line 381 of file client.py.

def redis.client.StrictRedis.debug_object (   self,
  key 
)

Definition at line 392 of file client.py.

def redis.client.StrictRedis.decr (   self,
  name,
  amount = 1 
)
Decrements the value of ``key`` by ``amount``.  If no key exists,
the value will be initialized as 0 - ``amount``

Definition at line 494 of file client.py.

def redis.client.StrictRedis.delete (   self,
  names 
)

Definition at line 396 of file client.py.

def redis.client.StrictRedis.echo (   self,
  value 
)

Definition at line 401 of file client.py.

def 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.

Definition at line 1221 of file client.py.

def 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.

Definition at line 1232 of file client.py.

def redis.client.StrictRedis.execute_command (   self,
  args,
  options 
)

COMMAND EXECUTION AND PROTOCOL PARSING ####.

Definition at line 339 of file client.py.

def redis.client.StrictRedis.exists (   self,
  name 
)

Definition at line 501 of file client.py.

def redis.client.StrictRedis.expire (   self,
  name,
  time 
)
Set an expire flag on key ``name`` for ``time`` seconds. ``time``
can be represented by an integer or a Python timedelta object.

Definition at line 506 of file client.py.

def redis.client.StrictRedis.expireat (   self,
  name,
  when 
)
Set an expire flag on key ``name``. ``when`` can be represented
as an integer indicating unix time or a Python datetime object.

Definition at line 515 of file client.py.

Definition at line 405 of file client.py.

Definition at line 409 of file client.py.

def 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.

Definition at line 222 of file client.py.

def redis.client.StrictRedis.get (   self,
  name 
)
Return the value at key ``name``, or None if the key doesn't exist

Definition at line 524 of file client.py.

def redis.client.StrictRedis.getbit (   self,
  name,
  offset 
)

Definition at line 540 of file client.py.

def redis.client.StrictRedis.getrange (   self,
  key,
  start,
  end 
)
Returns the substring of the string value stored at ``key``,
determined by the offsets ``start`` and ``end`` (both are inclusive)

Definition at line 467 of file client.py.

def redis.client.StrictRedis.getset (   self,
  name,
  value 
)
Set the value at key ``name`` to ``value`` if key doesn't exist
Return the value at key ``name`` atomically

Definition at line 544 of file client.py.

def redis.client.StrictRedis.hdel (   self,
  name,
  keys 
)

HASH COMMANDS ####.

Definition at line 1151 of file client.py.

def redis.client.StrictRedis.hexists (   self,
  name,
  key 
)

Definition at line 1155 of file client.py.

def redis.client.StrictRedis.hget (   self,
  name,
  key 
)

Definition at line 1159 of file client.py.

def redis.client.StrictRedis.hgetall (   self,
  name 
)

Definition at line 1163 of file client.py.

def redis.client.StrictRedis.hincrby (   self,
  name,
  key,
  amount = 1 
)

Definition at line 1167 of file client.py.

def redis.client.StrictRedis.hkeys (   self,
  name 
)

Definition at line 1171 of file client.py.

def redis.client.StrictRedis.hlen (   self,
  name 
)

Definition at line 1175 of file client.py.

def redis.client.StrictRedis.hmget (   self,
  name,
  keys,
  args 
)

Definition at line 1205 of file client.py.

def redis.client.StrictRedis.hmset (   self,
  name,
  mapping 
)
Sets each key in the ``mapping`` dict to its corresponding value
in the hash ``name``

Definition at line 1193 of file client.py.

def redis.client.StrictRedis.hset (   self,
  name,
  key,
  value 
)
Set ``key`` to ``value`` within hash ``name``
Returns 1 if HSET created a new field, otherwise 0

Definition at line 1179 of file client.py.

def redis.client.StrictRedis.hsetnx (   self,
  name,
  key,
  value 
)
Set ``key`` to ``value`` within hash ``name`` if ``key`` does not
exist.  Returns 1 if HSETNX created a field, otherwise 0.

Definition at line 1186 of file client.py.

def redis.client.StrictRedis.hvals (   self,
  name 
)

Definition at line 1210 of file client.py.

def redis.client.StrictRedis.incr (   self,
  name,
  amount = 1 
)
Increments the value of ``key`` by ``amount``.  If no key exists,
the value will be initialized as ``amount``

Definition at line 551 of file client.py.

Definition at line 413 of file client.py.

def redis.client.StrictRedis.keys (   self,
  pattern = '*' 
)

Definition at line 558 of file client.py.

Return a Python datetime object representing the last time the
Redis database was saved to disk

Definition at line 417 of file client.py.

def redis.client.StrictRedis.lindex (   self,
  name,
  index 
)
Return the item from list ``name`` at position ``index``

Negative indexes are supported and will return an item at the
end of the list

Definition at line 734 of file client.py.

def redis.client.StrictRedis.linsert (   self,
  name,
  where,
  refvalue,
  value 
)
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.

Definition at line 743 of file client.py.

def redis.client.StrictRedis.llen (   self,
  name 
)

Definition at line 753 of file client.py.

def 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.

Definition at line 316 of file client.py.

def redis.client.StrictRedis.lpop (   self,
  name 
)

Definition at line 757 of file client.py.

def redis.client.StrictRedis.lpush (   self,
  name,
  values 
)

Definition at line 761 of file client.py.

def redis.client.StrictRedis.lpushx (   self,
  name,
  value 
)

Definition at line 765 of file client.py.

def redis.client.StrictRedis.lrange (   self,
  name,
  start,
  end 
)
Return a slice of the list ``name`` between
position ``start`` and ``end``

``start`` and ``end`` can be negative numbers just like
Python slicing notation

Definition at line 769 of file client.py.

def 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 redis.client.Redis.

Definition at line 779 of file client.py.

def redis.client.StrictRedis.lset (   self,
  name,
  index,
  value 
)

Definition at line 791 of file client.py.

def redis.client.StrictRedis.ltrim (   self,
  name,
  start,
  end 
)
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

Definition at line 795 of file client.py.

def redis.client.StrictRedis.mget (   self,
  keys,
  args 
)
Returns a list of values ordered identically to ``keys``

Definition at line 562 of file client.py.

def redis.client.StrictRedis.move (   self,
  name,
  db 
)

Definition at line 586 of file client.py.

def redis.client.StrictRedis.mset (   self,
  mapping 
)

Definition at line 569 of file client.py.

def redis.client.StrictRedis.msetnx (   self,
  mapping 
)
Sets each key in the ``mapping`` dict to its corresponding value if
none of the keys are already set

Definition at line 576 of file client.py.

def redis.client.StrictRedis.object (   self,
  infotype,
  key 
)

Definition at line 424 of file client.py.

def redis.client.StrictRedis.parse_response (   self,
  connection,
  command_name,
  options 
)

Definition at line 354 of file client.py.

def redis.client.StrictRedis.persist (   self,
  name 
)

Definition at line 590 of file client.py.

Definition at line 428 of file client.py.

def 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 redis.client.Redis.

Definition at line 285 of file client.py.

def redis.client.StrictRedis.publish (   self,
  channel,
  message 
)
Publish ``message`` on ``channel``.
Returns the number of subscribers the message was delivered to.

Definition at line 1214 of file client.py.

def redis.client.StrictRedis.pubsub (   self,
  shard_hint = None 
)
Return a Publish/Subscribe object. With this object, you can
subscribe to channels and listen for messages that get published to
them.

Definition at line 330 of file client.py.

Definition at line 594 of file client.py.

def redis.client.StrictRedis.register_script (   self,
  script 
)
Register a LUA ``script`` specifying the ``keys`` it will touch.
Returns a Script object that is callable and hides the complexity of
deal with scripts, keys, and shas. This is the preferred way to work
with LUA scripts.

Definition at line 1268 of file client.py.

def redis.client.StrictRedis.rename (   self,
  src,
  dst 
)
Rename key ``src`` to ``dst``

Definition at line 598 of file client.py.

def redis.client.StrictRedis.renamenx (   self,
  src,
  dst 
)

Definition at line 604 of file client.py.

def redis.client.StrictRedis.rpop (   self,
  name 
)

Definition at line 805 of file client.py.

def redis.client.StrictRedis.rpoplpush (   self,
  src,
  dst 
)
RPOP a value off of the ``src`` list and atomically LPUSH it
on to the ``dst`` list.  Returns the value.

Definition at line 809 of file client.py.

def redis.client.StrictRedis.rpush (   self,
  name,
  values 
)

Definition at line 816 of file client.py.

def redis.client.StrictRedis.rpushx (   self,
  name,
  value 
)

Definition at line 820 of file client.py.

def redis.client.StrictRedis.sadd (   self,
  name,
  values 
)

SET COMMANDS ####.

Definition at line 879 of file client.py.

Tell the Redis server to save its data to disk,
blocking until the save is complete

Definition at line 432 of file client.py.

def redis.client.StrictRedis.scard (   self,
  name 
)

Definition at line 883 of file client.py.

def redis.client.StrictRedis.script_exists (   self,
  args 
)
Check if a script exists in the script cache by specifying the SHAs of
each script as ``args``. Returns a list of boolean values indicating if
if each already script exists in the cache.

Definition at line 1244 of file client.py.

Definition at line 1253 of file client.py.

Definition at line 1258 of file client.py.

def redis.client.StrictRedis.script_load (   self,
  script 
)

Definition at line 1263 of file client.py.

def redis.client.StrictRedis.sdiff (   self,
  keys,
  args 
)

Definition at line 887 of file client.py.

def redis.client.StrictRedis.sdiffstore (   self,
  dest,
  keys,
  args 
)
Store the difference of sets specified by ``keys`` into a new
set named ``dest``.  Returns the number of keys in the new set.

Definition at line 892 of file client.py.

def redis.client.StrictRedis.set (   self,
  name,
  value 
)

Definition at line 608 of file client.py.

def redis.client.StrictRedis.set_response_callback (   self,
  command,
  callback 
)

Definition at line 281 of file client.py.

def redis.client.StrictRedis.setbit (   self,
  name,
  offset,
  value 
)
Flag the ``offset`` in ``name`` as ``value``. Returns a boolean
indicating the previous value of ``offset``.

Definition at line 613 of file client.py.

def 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 redis.client.Redis.

Definition at line 621 of file client.py.

def redis.client.StrictRedis.setnx (   self,
  name,
  value 
)

Definition at line 631 of file client.py.

def 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.

Definition at line 635 of file client.py.

Definition at line 439 of file client.py.

def redis.client.StrictRedis.sinter (   self,
  keys,
  args 
)

Definition at line 900 of file client.py.

def redis.client.StrictRedis.sinterstore (   self,
  dest,
  keys,
  args 
)
Store the intersection of sets specified by ``keys`` into a new
set named ``dest``.  Returns the number of keys in the new set.

Definition at line 905 of file client.py.

def redis.client.StrictRedis.sismember (   self,
  name,
  value 
)

Definition at line 913 of file client.py.

def redis.client.StrictRedis.slaveof (   self,
  host = None,
  port = None 
)
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.

Definition at line 448 of file client.py.

def redis.client.StrictRedis.smembers (   self,
  name 
)

Definition at line 917 of file client.py.

def redis.client.StrictRedis.smove (   self,
  src,
  dst,
  value 
)

Definition at line 921 of file client.py.

def 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``

Definition at line 824 of file client.py.

def redis.client.StrictRedis.spop (   self,
  name 
)

Definition at line 925 of file client.py.

def redis.client.StrictRedis.srandmember (   self,
  name 
)

Definition at line 929 of file client.py.

def redis.client.StrictRedis.srem (   self,
  name,
  values 
)

Definition at line 933 of file client.py.

def redis.client.StrictRedis.strlen (   self,
  name 
)

Definition at line 648 of file client.py.

def redis.client.StrictRedis.substr (   self,
  name,
  start,
  end = -1 
)
Return a substring of the string at key ``name``. ``start`` and ``end``
are 0-based integers specifying the portion of the string to return.

Definition at line 652 of file client.py.

def redis.client.StrictRedis.sunion (   self,
  keys,
  args 
)

Definition at line 937 of file client.py.

def redis.client.StrictRedis.sunionstore (   self,
  dest,
  keys,
  args 
)
Store the union of sets specified by ``keys`` into a new
set named ``dest``.  Returns the number of keys in the new set.

Definition at line 942 of file client.py.

Returns the server time as a 2-item tuple of ints:
(seconds since epoch, microseconds into this second).

Definition at line 385 of file client.py.

def redis.client.StrictRedis.transaction (   self,
  func,
  watches,
  kwargs 
)
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.

Definition at line 299 of file client.py.

def redis.client.StrictRedis.ttl (   self,
  name 
)

Definition at line 659 of file client.py.

def redis.client.StrictRedis.type (   self,
  name 
)

Definition at line 663 of file client.py.

Unwatches the value at key ``name``, or None of the key doesn't exist

Definition at line 673 of file client.py.

def redis.client.StrictRedis.watch (   self,
  names 
)
Watches the values at keys ``names``, or None if the key doesn't exist

Definition at line 667 of file client.py.

def 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 redis.client.Redis.

Definition at line 951 of file client.py.

def redis.client.StrictRedis.zcard (   self,
  name 
)

Definition at line 973 of file client.py.

def redis.client.StrictRedis.zcount (   self,
  name,
  min,
  max 
)

Definition at line 977 of file client.py.

def redis.client.StrictRedis.zincrby (   self,
  name,
  value,
  amount = 1 
)

Definition at line 980 of file client.py.

def redis.client.StrictRedis.zinterstore (   self,
  dest,
  keys,
  aggregate = None 
)
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.

Definition at line 984 of file client.py.

def 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

Definition at line 992 of file client.py.

def 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

Definition at line 1017 of file client.py.

def redis.client.StrictRedis.zrank (   self,
  name,
  value 
)
Returns a 0-based value indicating the rank of ``value`` in sorted set
``name``

Definition at line 1043 of file client.py.

def redis.client.StrictRedis.zrem (   self,
  name,
  values 
)

Definition at line 1050 of file client.py.

def redis.client.StrictRedis.zremrangebyrank (   self,
  name,
  min,
  max 
)
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

Definition at line 1054 of file client.py.

def redis.client.StrictRedis.zremrangebyscore (   self,
  name,
  min,
  max 
)
Remove all elements in the sorted set ``name`` with scores
between ``min`` and ``max``. Returns the number of elements removed.

Definition at line 1063 of file client.py.

def 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

Definition at line 1070 of file client.py.

def 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

Definition at line 1090 of file client.py.

def redis.client.StrictRedis.zrevrank (   self,
  name,
  value 
)
Returns a 0-based value indicating the descending rank of
``value`` in sorted set ``name``

Definition at line 1116 of file client.py.

def redis.client.StrictRedis.zscore (   self,
  name,
  value 
)

Definition at line 1123 of file client.py.

def redis.client.StrictRedis.zunionstore (   self,
  dest,
  keys,
  aggregate = None 
)
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.

Definition at line 1127 of file client.py.


Member Data Documentation

Definition at line 504 of file client.py.

Definition at line 399 of file client.py.

Definition at line 611 of file client.py.

Definition at line 251 of file client.py.

Reimplemented in redis.client.Redis.

Definition at line 169 of file client.py.

Definition at line 251 of file client.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


redis
Author(s): Daniel Stonier
autogenerated on Tue Jan 15 2013 17:43:13