Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyRelukko

PyPI - Version PyPI - Python Version Python Version from PEP 621 TOML Gitlab Pipeline Status PyPI - Downloads PyPI - License GitLab License PyPI - Format PyPI - Status PyPI - Implementation PyPI - Wheel GitLab Stars GitLab Forks


PyRelukko is the official Python client library for the Relukko resource-locking backend. It provides a simple, distributed locking mechanism for coordinating access to shared resources across multiple Python processes or services.

Relukko is intentionally lightweight: it is designed for collaborative environments. The system assumes clients behave cooperatively, and by design it does not enforce protection against misbehaving clients.

Documentation

Full API documentation can be found at:

👉 https://pyrelukko.readthedocs.io


Features

  • Simple, Pythonic API for acquiring and releasing locks.
  • Centralized lock management via the Relukko backend.
  • Lightweight and dependency-minimal.
  • Useful for distributed systems, CI pipelines, automated testing and shared-resource orchestration.

Important Design Note

Relukko and PyRelukko are built for trusted, collaborative clients.

⚠️ No client-side trust guarantees

A client that connects to the Relukko backend can forcibly release any lock, including those owned by another client. There is no protection against malicious manipulation of locks.

This is an intentional design decision to keep the system simple and lightweight.

If you require secure, adversarial-resistant locking, you should consider using a system built upon consensus algorithms (e.g., etcd, Consul, Zookeeper).


Ecosystem

The Relukko ecosystem consists of the following components:

1. Relukko Backend (Rust)

The backend is responsible for storing and arbitrating lock states.

Repository: https://gitlab.com/relukko/relukko

2. PyRelukko Client (Python)

This Python package communicates with the backend, providing user-friendly locking primitives.

Repository: https://gitlab.com/relukko/pyrelukko

👉 https://pyrelukko.readthedocs.io

3. Robotframework-Relukko (Python)

Robot Framework keyword library that enables acquiring and releasing locks directly from Robot Framework test suites. Depends on PyRelukko.

Repository: https://gitlab.com/relukko/robotframework-relukko


Installation

Install via pip:

pip install pyrelukko

Requires Python 3.11+.


Quick Start

Basic Example

from pyrelukko import RelukkoClient


relukko = RelukkoClient(
    base_url="http://localhost:3000",
    api_key="api-key",
)

lock = relukko.acquire_relukko("LockName", "Creator", 300)
lock_id = lock.get('id')

# Perform work while holding the lock

relukko.delete_relukko(lock_id)

When to Use PyRelukko

PyRelukko is ideal for:

  • Distributed test harnesses
  • CI/CD job coordination
  • Server orchestration scripts
  • Managing exclusive access to hardware devices or simulation environments
  • Any cooperative environment where multiple workers need a shared mutex

It is not designed for untrusted environments or where mutual exclusion must be strongly enforced.


Limitations

  • ❗ A malicious or buggy client can release locks it doesn’t own.
  • ❗ No cryptographic guarantees or client identity.
  • ❗ Requires a running Relukko backend server.
  • ❗ Not fault-tolerant like consensus-based systems.

These limitations are intentional, in exchange for simplicity and minimal overhead.


Running the Backend

The backend is written in Rust and provides a simple HTTP API. See the backend repository for instructions:

👉 https://gitlab.com/relukko/relukko


Contributing

Contributions to both the Python client and Rust backend are welcome! Feel free to open issues or merge requests in the relevant GitLab repository.


License

MIT License. See LICENSE for details.

Metadata

Release files for pyrelukko 0.12.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrelukko 0.12.0a3
File Size Uploaded Provenance Actions
pyrelukko-0.12.0a3.tar.gz 70.6 kB Without provenance Details for pyrelukko-0.12.0a3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrelukko 0.12.0a3
File Interpreter ABI Platform Actions
pyrelukko-0.12.0a3-py3-none-any.whl Python 3 none any Details for pyrelukko-0.12.0a3-py3-none-any.whl

Total release size: 87.8 kB

Release files / pyrelukko-0.12.0a3.tar.gz

Download URL pyrelukko-0.12.0a3.tar.gz
Size 70.6 kB
Tags Source
SHA-256 checksum
How to use checksums
113e6a595e162833f539b6907c17324f91120f4e098c0311d6d01e0d0d0eadd5
BLAKE2b-256 checksum
How to use checksums
9eb861100fcffe64125dc7ba2997a5171daf6c243160338ea9967f6d6c067817
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / pyrelukko-0.12.0a3-py3-none-any.whl

Download URL pyrelukko-0.12.0a3-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51f9bf2de8fb77146d8d50ed5f06b544610998c30c26c64f43c4d2ce039f5ac6
BLAKE2b-256 checksum
How to use checksums
5d1eadb2a3944b3ac96828bb480f3545f26501240d317dbb29c9e6b6812ed13b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.8

Security for pyrelukko 0.12.0a3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page