Skip to main content
DynaLock
https://img.shields.io/pypi/v/dynalock.svg Documentation Status

Distributed locking implementation in python with DynamoDB

Getting Started

To install DynaLock, simply use pip:

$ pip install dynalock

DynaLock utilizes Python’s context manager making it easier and safer to manage locks. When used in a with statement, DynaLock automatically acquires the lock at the beginning of the block and releases it upon exiting, regardless of whether the block exits normally or with an exception. This eliminates the need for explicit release calls, reducing the boilerplate code and minimizing the risk of errors.

Example Usage:

from dynalock import DynaLock

# Initialize a distributed lock
distributed_lock = DynaLock(
    table_name='my_lock_table',
    region_name='us-west-2',
    lock_id='api_lock',
)

# Use the lock with a context manager
with distributed_lock.lock():
    # Protected code goes here
    # The lock is automatically managed
    print("This code is protected by the lock")
    print("Critical section executed")

# The lock is automatically released after exiting the block
print("This code is not protected by the lock")

History

0.1.0 (2024-03-30)

  • First release on PyPI.

Metadata

Release files for dynalock 0.3.0

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

Source distribution (sdist)

Source distribution for dynalock 0.3.0
File Size Uploaded
dynalock-0.3.0.tar.gz 29.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dynalock 0.3.0
File Interpreter ABI Platform
dynalock-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 34.1 kB

Release files / dynalock-0.3.0.tar.gz

Download URL dynalock-0.3.0.tar.gz
Size 29.2 kB
Tags Source
SHA-256 checksum
How to use checksums
65737a0440557dc9b5cd2384683cd7d4d76429ed45f5f2488a91504b49885f7e
BLAKE2b-256 checksum
How to use checksums
ce3ae72397aa35119ff41dfb20344ae3ceba9cd98a852183f252b730660bef99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release files / dynalock-0.3.0-py2.py3-none-any.whl

Download URL dynalock-0.3.0-py2.py3-none-any.whl
Size 4.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4a68a1cb51e8628ce4a21cc9daef3555025db22c5257c1f660aeaf62aad1dc30
BLAKE2b-256 checksum
How to use checksums
ed36d207217e9b33c73b6014e274ca78779ee8727f63257d1e8cd14fec4dfcc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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