Skip to main content

A simple file-based lock utility for Python applications

Project description

locktools

A simple file-based lock utility for Python applications. Useful for pausing/resuming processes using a lock file, with human-readable timestamps.

Features

  • Create a lock file with a localized timestamp
  • Release (remove) the lock file
  • Check if the lock file exists

Installation

pip install locktools

Usage

from locktools import create_lock, release_lock, is_locked

# Create the lock file
create_lock()

# Check if locked
if is_locked():
    print("Locked!")

# Release the lock
release_lock()

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

locktools-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

locktools-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file locktools-0.1.0.tar.gz.

File metadata

  • Download URL: locktools-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for locktools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12616e4fb204ebbc2db7ac2d472ef7da26e5834146eab34ab7110410abebb257
MD5 7f267ae74733434238d1bbf7f75196ca
BLAKE2b-256 c42a677a30eb6cd13026e90f39c6b837ad950d50a31860303a9519a83585ac14

See more details on using hashes here.

File details

Details for the file locktools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: locktools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for locktools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a5f0a1bff7ccab82a3aff2243afca2dd1ee7819b26e00c28e186abe7c4109af
MD5 358677804d3f0a663239a074c047a0bd
BLAKE2b-256 68c339ef553ee7061a4d681aae3e50a7e8f14ae5a9fb2737226bd56c017f5daf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page