Registry / database / quart-redis

quart-redis

JSON →
library3.0.0pypypi✓ verified 82d ago

An extension for Quart that integrates Redis, providing support for caching, session storage, and pub/sub. Version 3.0.0 requires Python >=3.11 and Quart >=0.18. Released on 2023-12-01; maintenance cadence is irregular.

pip install quart-redis
INSTALL
IMPORT
SIG · QUART-REDIS
Q
quart-redis
databasepythonv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Redis
from quart_redis import Redis
from quart_redis import QuartRedis
get_redis
from quart_redis import get_redis
from_url
from quart_redis import from_url

Initialize QuartRedis with the Quart app, then acquire connections from the pool.

import asyncio from quart import Quart from quart_redis import QuartRedis, RedisConfig app = Quart(__name__) app.config['REDIS_URI'] = 'redis://localhost:6379/0' redis = QuartRedis(app) # or init later: redis.init_app(app) @app.route('/') async def index(): # Use redis.acquire() to get a connection conn = await redis.acquire() await conn.set('key', 'value') val = await conn.get('key') await redis.release(conn) return f'Got: {val}' if __name__ == '__main__': app.run()
Debug
Known issues
breakingIn version 3.0.0, the async Redis client changed from aredis to redis-py (redis.asyncio). Code using aredis must be migrated.
fix
Replace aredis usage with redis.asyncio. The QuartRedis interface remains the same but underlying client changed.
affects: <3.0.0
breakingThe 'REDIS_URI' config key is required; previously allowed multiple config keys. In 3.x, only REDIS_URI is used.
fix
Set app.config['REDIS_URI'] = 'redis://...' instead of separate host/port/db config.
affects: >=3.0.0
gotchaAlways release connections with redis.release(conn) after acquiring, or use the context manager 'async with redis.connection() as conn:'. Missing release will leak connections.
fix
Use 'async with redis.connection() as conn:' to auto-release.
affects: all
Upgrade
Version history
3.0.0latest on PyPI · released Feb 22, 2025
Audit
Dependencies
redis[hiredis]optionalRequired for async Redis support; hiredis recommended for performance.
quartrequiredRequired framework; version >=0.18 needed for Quart-Redis 3.x
Agent activity
7 hits · last 30 days
node
6
Resources

No resource links recorded.

quart-redis — pip install quart-redis · libregistry