--- id: python-dynamodb-lock version: "0.9.1" license: Apache Software License 2.0 license_treatment: permissive maintenance: dormant --- # python-dynamodb-lock — Python library that emulates the java-based dynamo-db-client from awslabs License: permissive · Maintenance: dormant · Downloads: 519.5K/mo ## What it is and what it does Python DynamoDB Lock is a distributed locking library built on DynamoDB that emulates the Java-based AmazonDynamoDBLockClient. It allows multiple processes or services to coordinate access to shared resources by acquiring named locks with configurable retry behavior, maintaining them through periodic heartbeats, and automatically releasing them after a configurable lease duration. The library supports both coarse-grained and fine-grained locking, stores arbitrary application data alongside locks, and uses monotonically increasing clocks to handle clock skew. It notifies applications via callback if a lock is stolen or nearing expiry. However, the documentation explicitly notes that locks do not participate in distributed transactions—if a heartbeat is delayed beyond the lease duration, another client may acquire the lock while the original holder is still processing, leading to potential data inconsistency if not handled at the application level. Use it for: - Coordinate database writes across multiple application instances to ensure only one process modifies a given resource at a time. - Implement leader election among distributed services using DynamoDB as the coordination backend. - Prevent concurrent execution of expensive batch jobs or scheduled tasks across a fleet of servers. - Serialize access to shared state stored in DynamoDB when multiple Lambda functions or microservices need to update it safely. - Build a distributed job queue where only one worker processes a given job at a time. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides distributed locking on top of DynamoDB with configurable retry semantics, heartbeat-based lease management, and lock-theft detection. Yes, with conditions. The package solves a real problem—distributed locking on DynamoDB—and has no known vulnerabilities. However, dormant maintenance (no updates since 2018-10-28) and classifiers limited to Python 3.6 and 3.7 raise questions about compatibility with modern Python versions. Verify it works with your target Python and boto3 versions before relying on it in production. The documented limitations around distributed transactions require careful application-level handling. ## Install pip install python-dynamodb-lock uv add python-dynamodb-lock poetry add python-dynamodb-lock ## Installing python-dynamodb-lock Before you install: Low install friction with only boto3 and botocore as runtime dependencies. Maintenance is dormant—last release was 2018-10-28 with no updates since, though the repository remains active. License in practice: Licensed under Apache Software License 2.0 (permissive), allowing use in most commercial and open-source projects with minimal restrictions. Quickstart: pip install python-dynamodb-lock from python_dynamodb_lock import DynamoDBLock import boto3 dynamodb = boto3.resource('dynamodb') lock = DynamoDBLock(dynamodb, 'lock-table-name') lock.acquire('my-lock-name') Requires an existing DynamoDB table and AWS credentials configured for boto3. Verify before relying: - Whether the package works reliably with Python versions beyond 3.7, given classifiers list only 3.6 and 3.7. - Current compatibility with recent boto3 and botocore versions and whether breaking changes have occurred since 2018. - Whether the lock-theft callback and heartbeat mechanism perform reliably under high-latency or GC-pause conditions. ## Package facts - License: Apache Software License 2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 519.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dynamodb distributed locking, aws dynamodb lock client, python distributed locks, dynamodb lease management, concurrent access control dynamodb, lock heartbeat renewal, multi-process synchronization aws, dynamodb, distributed-locking, aws [View on SkillFed](https://skillfed.io/packages/python-dynamodb-lock) · [View on PyPI](https://pypi.org/project/python-dynamodb-lock/)