skillfed

redlock-py

Redis locking mechanism

redlock-py v1.0.8 246.9K downloads/30d#8,704 on PyPI
Permissive license UNKNOWN Abandoned released

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-py

uv

uv add redlock-py

poetry

poetry add redlock-py

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4

Tags

redis distributed locksredlock algorithm pythonredis locking mechanismdistributed lock managerredis resource lockingconcurrent access control redismulti-instance redis locks
distributed-lockingredisabandoned

More Distributed Computing packages