py-redis
A convenience wrapper for the official Python redis package
What it is and what it does
Py-Redis is a thin wrapper around the official redis Python package that reduces boilerplate for common operations. It wraps the Redis client in a context manager so connections are automatically cleaned up, automatically serializes and deserializes data to JSON on set and get, and provides batch helper methods like get_keys() and set_dict() to work with multiple keys at once using pattern matching.
The package is designed for developers who want simpler Redis usage without manually handling connection lifecycle or JSON encoding. It exposes the underlying redis.Redis object via a .R attribute if you need to fall back to direct client calls. However, the package has not been maintained since its latest release, so it may have compatibility issues with newer versions of redis or Python itself.
Use it for:
- Caching application data (strings, lists, dicts) with automatic JSON serialization in a context manager.
- Bulk operations on related Redis keys using pattern matching without writing loops.
- Quick prototyping or scripts where connection lifecycle management and JSON handling are tedious.
- Migrating from direct redis client usage to a simpler API without rewriting all calls.
- Setting and retrieving Python dictionaries and lists directly without manual JSON encoding.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A convenience wrapper around the official Redis Python client that adds automatic JSON serialization, context manager support, and helper methods for working with multiple keys at once.
No, not for new projects. The package is abandoned and offers only convenience features over the official redis client—not critical functionality. For new work, use redis directly or a more actively maintained wrapper. Only consider py-redis if you're maintaining legacy code that already depends on it and have no compatibility issues with your current environment.
Install
py-redis on PyPI
pip
pip install py-redisuv
uv add py-redispoetry
poetry add py-redisInstalling py-redis
Before you install
Installation is straightforward with low friction, but the package has been abandoned since its latest release on 2021-12-13. No active maintenance means security issues or compatibility problems would not be addressed.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.
Quickstart
pip install py-redis
from pyredis import RedisConnection
redis_args = {'host': 'localhost'}
with RedisConnection(**redis_args) as my_redis:
my_redis.set('key', 'value')
data = my_redis.get('key')
Requires a running Redis server accessible at the host and port you specify.
Verify before relying
- Whether the package remains compatible with current versions of redis and Python 3.x releases.
- Whether JSON serialization handles all data types you need or has edge cases with nested structures.
- Performance overhead of the wrapper layer compared to direct redis client usage.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — redis |
| Maintenance | abandoned — 1,705 days since the last release |
| First released | |
| Downloads | 346,387/month — #7,354 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_redis-1.1.1-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
redis-cliProvides a lightweight wrapper around redis-py…
permissive · top 15,000 on PyPI
flask-redisIntegrates Redis into Flask applications as a…
unclear · top 15,000 on PyPI
fakeredisfakeredis provides an in-memory, pure-Python…
permissive · top 1,000 on PyPI
channels-redisProvides Redis-backed channel layers for Django…
permissive · top 5,000 on PyPI
redisliteRedislite embeds a self-contained Redis server…
permissive · top 15,000 on PyPI
valkeyPython client library for connecting to and…
permissive · top 5,000 on PyPI
redis-omRedis OM provides declarative object mapping…
permissive · top 15,000 on PyPI
flatten-dictConverts nested dictionaries into flat…
permissive · top 5,000 on PyPI
django-cache-urlConfigures Django cache backends from…
permissive · top 15,000 on PyPI