Skip to main content

sanic-redis-extension

Redis support for Sanic framework

Features

  • Based on the redis library

  • Easy to use and configurate for your own projects

Installation

This package should be installed using pip:

pip install sanic-redis-extension

Example

from sanic import Sanic, response
from sanic_redis_ext import RedisExtension


app = Sanic(__name__)
# Configuration for Redis
app.config.update({
    "REDIS_HOST": "127.0.0.1",
    "REDIS_PORT": 6379,
    "REDIS_DATABASE": 0,
    "REDIS_MAX_CONNECTIONS": 15,
})
RedisExtension(app) # Connection pool is available as `app.ctx.redis` or `app.ctx.extensions['redis']`


@app.route("/")
async def handle(request):
    await request.app.ctx.redis.set('test-my-key', 'value')
    val = await request.app.ctx.redis.get('test-my-key')
    return response.text(val.decode('utf-8'))

License

The sanic-redis-extension is published under BSD license. For more details read LICENSE file.

Metadata

Release files for sanic-redis-extension 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sanic-redis-extension 0.2.0
File Size Uploaded Provenance Actions
sanic-redis-extension-0.2.0.tar.gz 4.0 kB Without provenance Details for sanic-redis-extension-0.2.0.tar.gz

Release files / sanic-redis-extension-0.2.0.tar.gz

Download URL sanic-redis-extension-0.2.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
16e172b4e5c1ebefdb7a1a88070786d5a4225d2c1cf1161f8668407cbff5cd21
BLAKE2b-256 checksum
How to use checksums
a4395075bfc05924836fdb75eb46271ba9c4fa4f263c49093a049b33cc9ce7dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.5

Security for sanic-redis-extension 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page