{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/4"}],"enrichment":{"capability":"Provides a Redis-backed distributed lock with a threading.Lock-like interface, supporting blocking/non-blocking acquire, expiry, auto-renewal, and owner identification across processes.","skillfed_tags":["distributed-locking","redis","concurrency"],"use_cases":["Prevent multiple application instances from running the same scheduled task simultaneously in a distributed system.","Coordinate database migrations or schema changes across a cluster without conflicts.","Implement cache-stampede prevention in Django by locking cache misses so only one request recomputes expensive data.","Protect critical sections in microservices that share state via Redis.","Recover from application crashes by setting an expiry on locks so they auto-release after a timeout."],"what_it_does":"python-redis-lock is a distributed locking library that uses Redis to coordinate access to shared resources across multiple processes or machines. It implements a Lock class with an interface matching Python's threading.Lock, so it integrates naturally into existing code patterns. The lock uses Redis SETNX for acquisition and BLPOP for efficient waiting, avoiding spinloops and polling.\n\nThe package supports optional expiry (to recover from crashes), auto-renewal (to keep a lock active while your code runs), timeouts, and owner identification (to detect which process or machine holds a lock). It works with redis and includes a Django cache backend integration for preventing cache-stampede problems. Maintenance is active, Python 3.7 or later is supported, and there are no known security vulnerabilities.","worth_installing":"Yes. This is a mature, actively maintained library (last release 128 days ago) with a simple, well-understood interface, zero security issues, and low install friction. Use it when you need cross-process locking backed by Redis and want to avoid spinloops or polling. The only prerequisite is a running Redis server."},"id":"python-redis-lock","links":{"html":"https://skillfed.io/packages/python-redis-lock","md":"https://skillfed.io/packages/python-redis-lock.md","pypi":"https://pypi.org/project/python-redis-lock/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-08","license_spdx":"BSD-2-Clause","license_treatment":"permissive","name":"python-redis-lock","python_support":"supports_current","summary":"Lock context manager implemented via redis SETNX/BLPOP."},"popularity":{"monthly_downloads":1152958,"position":4294,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"4.0.1"}
