.. figure:: ./DynaLockLogo.png
:alt: DynaLock
:align: center
.. image:: https://img.shields.io/pypi/v/dynalock.svg
:target: https://pypi.python.org/pypi/dynalock
.. image:: https://readthedocs.org/projects/dynalock/badge/?version=latest
:target: https://dynalock.readthedocs.io/en/latest/?version=latest
:alt: Documentation Status
Distributed locking implementation in python with DynamoDB
Getting Started
----------------
To install DynaLock, simply use pip:
.. code-block:: bash
$ 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:**
.. code-block:: python
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")
* Free software: MIT license
* Full Documentation: https://dynalock.readthedocs.io.
=======
History
=======
0.1.0 (2024-03-30)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/skywalker427/dynalock",
"name": "dynalock",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "dynalock",
"author": "Hamzah Bawah",
"author_email": "bhamza123@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ce/3a/e72397aa35119ff41dfb20344ae3ceba9cd98a852183f252b730660bef99/dynalock-0.3.0.tar.gz",
"platform": null,
"description": ".. figure:: ./DynaLockLogo.png\n :alt: DynaLock \n :align: center\n\n\n.. image:: https://img.shields.io/pypi/v/dynalock.svg\n :target: https://pypi.python.org/pypi/dynalock\n\n\n.. image:: https://readthedocs.org/projects/dynalock/badge/?version=latest\n :target: https://dynalock.readthedocs.io/en/latest/?version=latest\n :alt: Documentation Status\n\n\n\n\nDistributed locking implementation in python with DynamoDB\n\nGetting Started\n----------------\nTo install DynaLock, simply use pip:\n\n.. code-block:: bash\n\n $ pip install dynalock\n\n\nDynaLock utilizes Python's context manager making it easier and safer to manage locks. \nWhen 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. \nThis eliminates the need for explicit release calls, reducing the boilerplate code and minimizing the risk of errors.\n\n**Example Usage:**\n\n.. code-block:: python\n\n from dynalock import DynaLock\n\n # Initialize a distributed lock\n distributed_lock = DynaLock(\n table_name='my_lock_table',\n region_name='us-west-2',\n lock_id='api_lock',\n )\n\n # Use the lock with a context manager\n with distributed_lock.lock():\n # Protected code goes here\n # The lock is automatically managed\n print(\"This code is protected by the lock\")\n print(\"Critical section executed\")\n \n # The lock is automatically released after exiting the block\n print(\"This code is not protected by the lock\")\n\n\n\n* Free software: MIT license\n* Full Documentation: https://dynalock.readthedocs.io.\n\n\n\n\n\n\n=======\nHistory\n=======\n\n0.1.0 (2024-03-30)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Distributed locking with DynamoDB",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/skywalker427/dynalock"
},
"split_keywords": [
"dynalock"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ed36d207217e9b33c73b6014e274ca78779ee8727f63257d1e8cd14fec4dfcc7",
"md5": "93618e97b417eb29e849e91cb712a3e2",
"sha256": "4a68a1cb51e8628ce4a21cc9daef3555025db22c5257c1f660aeaf62aad1dc30"
},
"downloads": -1,
"filename": "dynalock-0.3.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "93618e97b417eb29e849e91cb712a3e2",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 4924,
"upload_time": "2024-04-01T16:26:11",
"upload_time_iso_8601": "2024-04-01T16:26:11.503094Z",
"url": "https://files.pythonhosted.org/packages/ed/36/d207217e9b33c73b6014e274ca78779ee8727f63257d1e8cd14fec4dfcc7/dynalock-0.3.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ce3ae72397aa35119ff41dfb20344ae3ceba9cd98a852183f252b730660bef99",
"md5": "ed00be97018933dc1ec4cdafaafd1f82",
"sha256": "65737a0440557dc9b5cd2384683cd7d4d76429ed45f5f2488a91504b49885f7e"
},
"downloads": -1,
"filename": "dynalock-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "ed00be97018933dc1ec4cdafaafd1f82",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 29171,
"upload_time": "2024-04-01T16:26:13",
"upload_time_iso_8601": "2024-04-01T16:26:13.564541Z",
"url": "https://files.pythonhosted.org/packages/ce/3a/e72397aa35119ff41dfb20344ae3ceba9cd98a852183f252b730660bef99/dynalock-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-01 16:26:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "skywalker427",
"github_project": "dynalock",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "dynalock"
}