Module Expr Str Import alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpAdd Str Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr For NameStore NameLoad body Expr Yield Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad body Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Return Call NameLoad GeneratorExp TupleLoad Call NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Assign NameStore SubscriptLoad NameLoad Index NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad NameStore NameLoad Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore ListLoad NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Num NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Num Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad AttributeLoad NameLoad attr Return SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults Dict kwarg body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareIs AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call Call NameLoad NameLoad Str AttributeLoad NameLoad attr If NameLoad body Assign NameStore GeneratorExp NameLoad comprehension TupleStore NameStore NameStore NameLoad comprehension NameStore TupleLoad NameLoad NameLoad orelse Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore GeneratorExp NameLoad comprehension TupleStore NameStore NameStore NameLoad comprehension NameStore TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Num For NameStore Call AttributeLoad NameLoad attr NameLoad BinOpMult NameLoad Num body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad Str attr GeneratorExp Call AttributeLoad Str attr NameLoad comprehension NameStore NameLoad Return Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A :mod:`sider.hash` --- Hash objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. seealso::

    `Redis Data Types <http://redis.io/topics/data-types>`_
       The Redis documentation that explains about its data
       types: strings, lists, sets, sorted sets and hashes.

 N/A collections session Session types Bulk String transaction query manipulative N/A utils Hash N/A N/A collections MutableMapping N/A N/A The Python-side representaion of Redis hash value.  It behaves
    such as built-in Python :class:`dict` object.  More exactly, it
    implements :class:`collections.MutableMapping` protocol.

    .. table:: Mappings of Redis commands--:class:`Hash` methods

       ===================== ===========================================
       Redis commands        :class:`Hash` methods
       ===================== ===========================================
       :redis:`DEL`          :meth:`Hash.clear()`
       :redis:`HDEL`         :keyword:`del` (:meth:`Hash.__delitem__()`)
       :redis:`HEXISTS`      :keyword:`in` (:meth:`Hash.__contains__()`)
       :redis:`HGET`         :meth:`Hash.__getitem__()`,
                             :meth:`Hash.get()`
       :redis:`HGETALL`      :meth:`Hash.items()`
       :redis:`HINCRBY`      N/A
       :redis:`HINCRBYFLOAT` N/A
       :redis:`HKEYS`        :func:`iter()` (:meth:`Hash.__iter__()`),
                             :meth:`Hash.keys()`
       :redis:`HLEN`         :func:`len()` (:meth:`Hash.__len__()`)
       :redis:`HMGET`        N/A
       :redis:`HMSET`        :meth:`Hash.update()`
       :redis:`HSET`         :token:`=` (:meth:`Hash.__setitem__()`)
       :redis:`HSETNX`       :meth:`Hash.setdefault()`
       :redis:`HVALS`        :meth:`Hash.values()`
       N/A                   :meth:`Hash.pop()`
       N/A                   :meth:`Hash.popitem()`
       ===================== ===========================================

     N/A key_type None N/A value_type None __init__ N/A N/A self session key key_type value_type N/A String String N/A N/A N/A N/A isinstance session Session N/A N/A N/A TypeError N/A session must be a sider.session.Session instance, not  N/A repr session N/A N/A self session session N/A N/A self key key N/A N/A self key_type N/A N/A Bulk ensure_value_type key_type parameter key_type N/A N/A self value_type N/A N/A Bulk ensure_value_type value_type parameter value_type N/A __iter__ N/A N/A self N/A N/A N/A Iterates over its :meth:`keys()`.

        :returns: the iterator which yields its keys
        :rtype: :class:`collections.Iterator`

        .. note::

           It is directly mapped to Redis :redis:`HKEYS` command.

         N/A keys N/A N/A N/A N/A self session client hkeys N/A self key N/A decode N/A N/A self key_type decode N/A key keys N/A N/A N/A N/A decode key N/A query __len__ N/A N/A self N/A N/A N/A Gets the number of items.

        :returns: the number of items
        :rtype: :class:`numbers.Integral`

        .. note::

           It is directly mapped to Redis :redis:`HLEN` command.

         N/A N/A N/A N/A N/A self session client hlen N/A self key N/A query __contains__ N/A N/A self key N/A N/A N/A Tests whether the given ``key`` exists.

        :param key: the key
        :returns: ``True`` if the ``key`` exists or ``False``
        :rtype: :class:`bool`

        .. note::

           It is directly mapped to Redis :redis:`HEXISTS` command.

         N/A N/A N/A encoded_key N/A N/A N/A self key_type encode key N/A N/A N/A TypeError N/A N/A False N/A exists N/A N/A N/A N/A self session client hexists N/A self key encoded_key N/A N/A bool exists N/A query __getitem__ N/A N/A self key N/A N/A N/A Gets the value of the given ``key``.

        :param key: the key to get its value
        :returns: the value of the ``key``
        :raises exceptions.TypeError:
           if the given ``key`` is not acceptable by
           its :attr:`key_type`
        :raises exceptions.KeyError:
           if there's no such ``key``

        .. note::

           It is directly mapped to Redis :redis:`HGET` command.

         N/A field N/A N/A N/A self key_type encode key N/A value N/A N/A N/A N/A self session client hget N/A self key field N/A N/A value None N/A N/A N/A KeyError key N/A N/A N/A N/A self value_type decode value N/A query __setitem__ N/A N/A self key value N/A N/A N/A Sets the ``key`` with the ``value``.

        :param key: the key to set
        :param value: the value to set
        :raises exceptions.TypeError:
           if the given ``key`` is not acceptable by
           its :attr:`key_type` or the given ``value``
           is not acceptable by its :attr:`value_type`

        .. note::

           It is directly mapped to Redis :redis:`HSET` command.

         N/A encoded_key N/A N/A N/A self key_type encode key N/A encoded_val N/A N/A N/A self value_type encode value N/A N/A N/A N/A N/A self session client hset N/A self key encoded_key encoded_val N/A manipulative __delitem__ N/A N/A self key N/A N/A N/A Removes the ``key``.

        :param key: the key to delete
        :raises exceptions.TypeError:
           if the given ``key`` is not acceptable by
           its :attr:`key_type`
        :raises exceptions.KeyError:
           if there's no such ``key``

        .. note::

           It is directly mapped to Redis :redis:`HDEL` command.

         N/A session N/A self session N/A encoded N/A N/A N/A self key_type encode key N/A N/A N/A session current_transaction None N/A N/A ok N/A N/A N/A session client hdel N/A self key encoded N/A N/A N/A N/A session mark_query N/A N/A self key N/A ok N/A N/A N/A session client hexists N/A self key encoded N/A ok N/A N/A N/A N/A session mark_manipulative N/A N/A N/A N/A session client hdel N/A self key encoded N/A N/A ok N/A N/A N/A KeyError key N/A keys N/A N/A self N/A N/A N/A Gets its all keys.  Equivalent to :meth:`__iter__()` except
        it returns a :class:`~collections.Set` instead of iterable.
        There isn't any meaningful order of keys.

        :returns: the set of its all keys
        :rtype: :class:`collections.KeysView`

        .. note::

           This method is directly mapped to Redis :redis:`HKEYS`
           command.

         N/A N/A frozenset self N/A values N/A N/A self N/A N/A N/A Gets its all values.  It returns a :class:`list` but
        there isn't any meaningful order of values.

        :returns: its all values
        :rtype: :class:`collections.ValuesView`

        .. note::

           This method is directly mapped to Redis :redis:`HVALS`
           command.

         N/A values N/A N/A N/A N/A self session client hvals N/A self key N/A decode N/A N/A self value_type decode N/A N/A i val N/A enumerate values N/A N/A N/A values N/A i N/A decode val N/A values N/A query items N/A N/A self N/A N/A N/A Gets its all ``(key, value)`` pairs.
        There isn't any meaningful order of pairs.

        :returns: the set of ``(key, value)`` pairs (:class:`tuple`)
        :rtype: :class:`collections.ItemsView`

        .. note::

           This method is mapped to Redis :redis:`HGETALL` command.

         N/A items N/A N/A N/A N/A self session client hgetall N/A self key N/A decode_key N/A N/A self key_type decode N/A decode_value N/A N/A self value_type decode N/A N/A frozenset N/A N/A N/A decode_key k N/A decode_value N/A items N/A k N/A k items N/A query clear N/A N/A self N/A N/A N/A Removes all items from this hash.

        .. note::

           Under the hood it simply :redis:`DEL` the key.

         N/A N/A N/A N/A N/A self session client delete N/A self key N/A manipulative setdefault N/A N/A self key default N/A None N/A N/A Sets the given ``default`` value to the ``key``
        if it doesn't exist and then returns the current value
        of the ``key``.

        For example, the following code is::

            val = hash.setdefault('key', 'set this if not exist')

        equivalent to::

            try:
                val = hash['key']
            except KeyError:
                val = hash['key'] = 'set this if not exist'

        except :meth:`setdefault()` method is an atomic operation.

        :param key: the key to get or set
        :param default: the value to be set if the ``key``
                        doesn't exist
        :raises exceptions.TypeError:
           when the given ``key`` is not acceptable by its
           :attr:`key_type` or the given ``default`` value
           is not acceptable by its :attr:`value_type`

        .. note::

           This method internally uses Redis :redis:`HSETNX`
           command which is atomic.

         N/A N/A N/A N/A self session transaction None N/A N/A N/A N/A N/A self session mark_query N/A N/A N/A val N/A self N/A key N/A N/A N/A KeyError N/A N/A N/A N/A N/A self session mark_manipulative N/A N/A self key N/A N/A self N/A key val default N/A val N/A encoded_key N/A N/A N/A self key_type encode key N/A encoded_val N/A N/A N/A self value_type encode default N/A result N/A None block N/A N/A pipe N/A N/A N/A ok N/A N/A pipe hsetnx N/A self key encoded_key encoded_val N/A ok N/A N/A N/A result N/A 0 default N/A N/A value N/A N/A pipe hget N/A self key encoded_key N/A N/A result N/A 0 N/A N/A N/A self value_type decode value N/A N/A N/A pipe multi N/A N/A N/A N/A N/A N/A self session client transaction block N/A self key N/A N/A result N/A 0 N/A update N/A N/A self mapping N/A N/A keywords N/A N/A Updates the hash from the given ``mapping`` and keyword
        arguments.

        - If ``mapping`` has :meth:`~collections.Mapping.keys()`
          method, it does::

              for k in mapping:
                  self[k] = mapping[k]

        - If ``mapping`` lacks :meth:`~collections.Mapping.keys()` 
          method, it does::

              for k, v in mapping:
                  self[k] = v

        - In either case, this is followed by (where ``keywords``
          is a :class:`dict` of keyword arguments)::

              for k, v in keywords.items():
                  self[k] = v

        :param mapping: an iterable object of ``(key, value)``
                        pairs or a mapping object (which has
                        :meth:`~collections.Mapping.keys()`
                        method).  default is empty
        :type mapping: :class:`collections.Mapping`
        :param \*\*keywords: the keywords to update as well.
                             if its :attr:`key_type` doesn't
                             accept byte strings (:class:`str`)
                             it raises :exc:`~exceptions.TypeError`
        :raises exceptions.TypeError:
           if the ``mapping`` is not actually mapping or iterable,
           or the given keys and values to update aren't acceptable
           by its :attr:`key_type` and :attr:`value_type`
        :raises exceptions.ValueError:
           if the ``mapping`` is an iterable object which yields
           non-pair values e.g. ``[(1, 2, 3), (4,)]``

         N/A N/A isinstance mapping Hash N/A N/A mapping N/A N/A mapping items N/A value N/A dict mapping N/A N/A N/A value update keywords N/A pipe N/A N/A self session client N/A N/A N/A N/A self session current_transaction None N/A N/A pipe N/A N/A pipe pipeline N/A N/A N/A self _raw_update value pipe N/A N/A N/A N/A self session current_transaction None N/A N/A N/A N/A pipe execute N/A manipulative _raw_update N/A N/A self value pipe encoded N/A False N/A N/A items N/A N/A getattr value iteritems N/A value items N/A encoded N/A N/A flatten N/A val N/A N/A k v items N/A val N/A k v N/A N/A encode_key N/A N/A self key_type encode N/A encode_value N/A N/A self value_type encode N/A flatten N/A val N/A N/A k v items N/A val N/A N/A encode_key k N/A encode_value v N/A n 100 N/A chunk N/A N/A utils chunk flatten N/A n 2 N/A N/A N/A N/A pipe execute_command HMSET N/A self key chunk N/A __repr__ N/A N/A self N/A N/A N/A cls N/A type self N/A items N/A list N/A N/A self items N/A N/A N/A items sort key N/A N/A N/A elem N/A N/A elem N/A 0 N/A elements N/A N/A ,  join N/A N/A N/A {0!r}: {1!r} format pair N/A pair items N/A N/A N/A <{0}.{1} ({2!r}) {{{3}}}> format N/A cls __module__ N/A cls __name__ N/A self key elements N/A N/A