summaryrefslogtreecommitdiff
path: root/redis/commands/redismodules.py
blob: 5f629fb5ea1a6a324a13b3f01456d7f195d1d37b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from json import JSONEncoder, JSONDecoder


class RedisModuleCommands:
    """This class contains the wrapper functions to bring supported redis
    modules into the command namepsace.
    """

    def json(self, encoder=JSONEncoder(), decoder=JSONDecoder()):
        """Access the json namespace, providing support for redis json.
        """

        from .json import JSON
        jj = JSON(
                client=self,
                encoder=encoder,
                decoder=decoder)
        return jj

    def ft(self, index_name="idx"):
        """Access the search namespace, providing support for redis search.
        """

        from .search import Search
        s = Search(client=self, index_name=index_name)
        return s

    def ts(self):
        """Access the timeseries namespace, providing support for
        redis timeseries data.
        """

        from .timeseries import TimeSeries
        s = TimeSeries(client=self)
        return s