redlock-py
Redis locking mechanism
What it is and what it does
redlock-py is a Python implementation of the Redlock distributed lock algorithm, which coordinates access to shared resources across multiple Redis instances. You create a lock manager by pointing it at one or more Redis servers, then call lock() with a resource name and validity duration in milliseconds to acquire a lock, and unlock() to release it. The lock manager returns either False if acquisition failed or a named tuple with the lock's validity period, resource name, and a random key for safe reclamation.
The package has no runtime dependencies and is straightforward to integrate into applications that need cross-process or cross-machine synchronization. However, it is abandoned—the last release was 2016-03-08 and the declared Python support only extends to 3.4. The author includes a disclaimer that the algorithm is a proposal and was not formally analyzed, so you should understand the algorithm's guarantees and limitations before relying on it in production.
Use it for:
- Coordinate job execution across multiple worker processes or machines to ensure only one instance runs a critical task at a time.
- Prevent race conditions when multiple application instances need to update a shared resource in a database or external system.
- Implement a distributed mutex for protecting access to a limited resource such as a file, API quota, or database connection pool.
- Build a distributed task scheduler that ensures a scheduled job runs on only one node in a cluster.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements Redis-based distributed locks using the Redlock algorithm, allowing you to acquire and release locks across multiple Redis instances for coordinating access to shared resources.
No. The package is abandoned with last release 2016-03-08 and Python support declared only up to 3.4, creating serious compatibility and maintenance risk. While the MIT license is permissive and there are no known vulnerabilities, the lack of updates and uncertain behavior on modern Python versions makes it unsuitable for new projects. Consider a maintained alternative for production use.
Install
redlock-py on PyPI
pip
pip install redlock-pyuv
uv add redlock-pypoetry
poetry add redlock-pyInstalling redlock-py
Before you install
High install friction despite no runtime dependencies. The package is abandoned—last release was 2016-03-08, over 3811 days ago. Python version support declared only up to 3.4, making compatibility with modern Python versions uncertain.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute the code freely with minimal restrictions.
Quickstart
from redlock import Redlock
dlm = Redlock([{"host": "localhost", "port": 6379, "db": 0}])
my_lock = dlm.lock("my_resource_name", 1000)
if my_lock:
dlm.unlock(my_lock)
Requires a running Redis instance accessible at the configured host and port; the algorithm is a proposal and was not formally analyzed, so review the implementation before production use.
Verify before relying
- Whether the package works reliably with Python versions beyond 3.4 despite classifier claims.
- Current state of the upstream repository and whether it has been superseded by a maintained fork.
- Whether the Redlock algorithm implementation matches current best practices or has known limitations.
Package facts
| License | UNKNOWN (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,811 days since the last release |
| First released | |
| Downloads | 246,932/month — #8,704 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: redlock-py-1.0.8.tar.gz
Tags
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework…
permissive · top 100 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
smart-openProvides a unified, open()-compatible Python…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
rayRay is a distributed computing framework that…
permissive · top 1,000 on PyPI
aioredlockImplements the Redlock distributed lock…
permissive · top 15,000 on PyPI
fastrlockA C-level re-entrant lock for CPython that…
permissive · top 5,000 on PyPI
redlockImplements the RedLock algorithm to provide…
permissive · top 15,000 on PyPI
python-dynamodb-lockProvides distributed locking on top of DynamoDB…
permissive · top 15,000 on PyPI
python-redis-lockProvides a Redis-backed distributed lock with a…
permissive · top 5,000 on PyPI
PyMySQLLockProvides distributed locking primitives backed…
permissive · top 15,000 on PyPI
shadowcopyCopy files locked by other processes on Windows…
permissive · top 15,000 on PyPI
pyodide-lockParses, modifies, and writes pyodide-lock.json…
permissive · top 15,000 on PyPI
potteryPottery provides Python dict, set, list, deque,…
unclear · top 15,000 on PyPI