Urgent.News

What's breaking now, across thousands of outlets.

Tech

WRedis v1.0.0 LTS: Enterprise Redis architecture with true async/await and cache decorators

Interacting with Redis in Python often means juggling raw commands, untyped returns, thread-safety pitfalls, and reinventing distributed locks and caching loops across multiple services. WRedis v1.0.0 LTS is a battle-tested, production-ready Python library built for enterprise workloads with native async/await , declarative cache decorators, comprehensive Sentinel/Cluster high availability, and…

Redis v1.0.0 LTS is an enterprise-grade Python library designed for high-performance Redis architecture. The library supports both synchronous and asynchronous APIs, enabling zero background worker threads. It features declarative cache decorators, including @cache and @async_cache, which provide hit/miss telemetry and allow for custom Time-To-Live (TTL) policies.

The library offers robust high availability out of the box through native Redis Sentinel failover and support for Redis Cluster topology. It is built with strict typing, ensuring 100% type annotations compatible with strict mypy configurations. The library provides 12 managed data structures, including Bitsets, Hashes, Sets, Sorted Sets, Streams, Queues, Pub/Sub, Geo, HyperLogLog, Pipelines, and Atomic Transactions.

WRedis boasts a comprehensive test suite, featuring 800+ unit tests, 38 live integration tests against real Redis instances, and 19 concurrency stress tests. Its production implementation includes clean hash management using the RedisHashManager class. This class allows developers to create a hash in Redis with automatic JSON serialization. For instance, a user session profile can be created with fields like name, role, and active status, along with a TTL of 3600 seconds.

Additionally, the library includes specialized managers for bitmaps. The RedisBitmapManager enables real-time analytics by setting and counting bits. For example, a bit can be set for a user ID to indicate login activity, and the count of active users can be obtained efficiently with an O(1) operation.

To install WRedis, use the command 'pip install wredis'. The library's source code is available on GitHub at https://github.com/wisrovi/wredis, and it can be found on PyPI at https://pypi.org/project/wredis. The library was authored by William Steve Rodríguez Villamizar, also known as Wisrovi.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

Stop writing raw Kafka boilerplate in Python: A decorator is enough

Code is read twice as often as it is written — and the Kafka consumer loop is the code nobody enjoys re-reading. WKafka turns the entire consumer skeleton into a single, clean decorator.

  • WKafka library offers @kafka.consumer decorator to streamline Python Kafka consumer code
  • Automatically configures KAFKASERVER environment variable, defaults to localhost:9092
  • Tested with Python 3.9-3.14, open-source on GitHub and PyPI

The end of raw SQL strings: Pydantic v2 as your SQLite schema

Why should you maintain separate Pydantic schemas for your FastAPI endpoints and SQLAlchemy models for your database? WSQLite bridges the gap with zero boilerplate and enterprise performance.

  • WSQLite library simplifies SQLite schema management in Python apps
  • Pydantic v2 Native ORM mapping eliminates need for extra libraries
  • Auto-sync schema migrations and thread-safe connection pooling

More from Saturday 26 September →