Skip to main content


Project description

Redis support for sanic.

Built on top of [aioredis](


You can install this package as usual with pip:

pip install SanicRedis


from sanic import Sanic
from sanic.response import json
from SanicRedis import BaseRedis

app = Sanic(__name__)
redisdb = dict(redisdb=8, redishost='localhost', redisport=6379, redispwd='password')


# group key of redis
class GroupKey(BaseRedis):
__coll__ = 'GroupKey_' # GroupKey + key

async def test1(request):
await GroupKey.set('testkey', 'value') # key is GroupKey_testkey
result = await GroupKey.get('testkey') # get value of GroupKey_testkey
return json(result)

if __name__ == '__main__':


- [PyPI](

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for SanicRedis, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size SanicRedis-0.1.2.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page