wredis is a production-grade Python library that wraps Redis into 12 elegant managers with dual sync/async APIs, cache decorators with hit/miss metrics, Sentinel and Cluster HA, and over 200 ready-to-run examples.
Data Structures
Ready Examples
Test Coverage
Dual APIs
Enterprise Ready
Every Redis primitive wrapped in a clean, type-safe, and resilient manager.
Full synchronous and asyncio APIs. Import from wredis.sync or wredis.aio — same ergonomics, zero lock-in.
@cache and @async_cache with built-in hit/miss/error metrics, TTL management, and custom key builders. Cache-Aside pattern in one line.
Redis Sentinel auto-failover and Redis Cluster hash-slot routing. Automatic master discovery and replica detection.
Exponential backoff decorator for @retry and @async_retry. Configurable attempts, delays, and exception filtering.
12 exception types from WRedisError down to QueueError, StreamError, PubSubError. Catch precisely, never silence.
Built-in key length, TTL range, bitmap offset, score validity checks. Fail-fast before commands reach Redis.
From Bitmaps to Streams — every Redis data type has a dedicated manager with CRUD + TTL + existence checks.
Set, get, count bits
RedisBitmapManagerCRUD, JSON serialize, TTL
RedisHashManagerAdd, members, membership, remove
RedisSetManagerRank, score, range, increment
RedisSortedSetManagerThread consumers, gzip, retries
RedisQueueManagerPublish, subscribe, decorators
RedisPubSubManagerConsumer groups, XACK, XREAD
RedisStreamManagerGeoadd, distance, radius search
RedisGeoManagerProbabilistic counting, merge
RedisHyperLogLogManagerBatch commands, atomic sets
RedisPipelineManagerWATCH/MULTI/EXEC, SET NX
RedisTransactionManager@cache with hit-rate metrics
RedisCacheManagerEvery manager is self-contained with connection pooling, retry logic, auto-decoding, and verbose logging built in. Use sync for simplicity, async for scale.
Two HA strategies for mission-critical Redis deployments.
SentinelRedisManager — automatic failover with master/slave topology.
ClusterRedisManager — distributed hash-slot routing at scale.
From "hello world" to advanced enterprise patterns — every concept is demonstrated with runnable code.
Init, health check, context managers, retry, FastAPI integration, connection pooling, error handling, custom managers, logging, multiple DBs, batch ops, pipelines, testing, pool monitoring.
Async init, health check, context managers, retry, FastAPI integration, concurrent ops, connection pooling, error handling, custom managers, logging, multiple DBs, worker patterns, cache decorators, rate limiters.
Basic metrics, hit-rate monitoring, multi-zone cache, TTL impact, cache warming, invalidation, dashboard patterns, alerting, manual recording, async metrics, performance comparison, custom key builder, error handling.
Exception hierarchy, specific error catching, custom messages, validation errors, operation recovery, transaction errors, serialization errors, logging integration, retry on specific errors, graceful degradation, queue/stream/pubsub error handling.
Basic retry, custom exceptions, backoff timing, Redis read/write ops, DB connection, API calls, circuit breaker, logging, wrapper pattern, batch ops, fallback, timeout, async retry, FastAPI integration.
Basic, nested dicts, lists, unicode, none values, booleans, datetime, custom objects, large data, round-trip, error handling, tuples, long strings, Redis storage pattern.
Bitmap (read/write), Hash (CRUD), Sets, Sorted Sets, Queue (producer/consumer), Pub/Sub (pub/sub), Streams, Geo, HyperLogLog, Pipeline, Transaction — all with sync and async variants.
Sentinel basic, Cluster basic, Docker Compose with redislabs/redismod + Redis Commander UI.
wredis is part of the Wisrovi library family — designed to bridge the gap between complex enterprise infrastructure and clean, maintainable Python code. Every library is fully typed, rigorously tested, and production-hardened.
Explore Wisrovi Librariespip install wredis — one command, 12 data structures, infinite possibilities.