fasteners
A python package that provides useful locks
Decision gist · record as of 2026-08-14
Yes. Fasteners is a stable, dependency-free solution for a common problem (cross-process locking) with no known vulnerabilities. The aging maintenance status is not a concern for a mature, narrowly-scoped library. Install it if you need inter-process locks or reader-writer patterns; the low friction and permissive license make it a safe choice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction—pure Python wheel with no runtime dependencies.
- Maintenance is aging (last release 368 days ago, last commit 2025-09-09), but the repository is active and not archived; suitable for stable, mature use cases where frequent updates are not expected.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 (permissive) allows commercial and private use with minimal restrictions; safe for most projects.
last release 2025-08-11 (368 days) · last repo commit 2025-09-09 · 280 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 15,536,221 downloads/mo, #1,181 on PyPI
Alternatives
Verify before relying
pip install fasteners
import fasteners
lock = fasteners.InterProcessLock('path/to/lock.file')
with lock:
pass # exclusive access- Whether ReaderWriterLock works correctly with eventlet or other non-standard threading implementations without custom thread identification functions.
- Performance characteristics under high contention or with many concurrent readers/writers.
What it is and what it does
Fasteners extends Python's standard threading locks to cover inter-process synchronization and reader-writer lock patterns. It provides InterProcessLock for exclusive file-based locking across processes (using fcntl on Unix and _locking on Windows), InterProcessReaderWriterLock for multi-reader/single-writer patterns across processes, and ReaderWriterLock for the same pattern within a single process. All locks expose a context-manager interface compatible with threading.Lock, making them drop-in replacements for simple use cases.
The package has been stable since its first release in 2015 and supports current Python versions (3.10 through 3.13, plus PyPy). It has no external runtime dependencies, making installation and deployment straightforward. The implementation trades some features (reentrancy, lock upgrading) for cross-platform compatibility, guaranteeing only the intersection of Unix fcntl and Windows file-locking semantics.
Use it for
- Coordinate exclusive file access between multiple Python processes without a separate lock server.
- Implement reader-writer patterns where many processes read concurrently but writes must be exclusive.
- Protect shared resources in multi-threaded applications using the same API as standard threading.Lock.
- Ensure safe concurrent access to files or resources in cross-platform applications (Linux, macOS, Windows).
- Add process-level synchronization to existing code that already uses threading.Lock without major refactoring.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Fasteners is a stable, dependency-free solution for a common problem (cross-process locking) with no known vulnerabilities. The aging maintenance status is not a concern for a mature, narrowly-scoped library. Install it if you need inter-process locks or reader-writer patterns; the low friction and permissive license make it a safe choice.
Install
fasteners on PyPI
Before you install
Low friction—pure Python wheel with no runtime dependencies. Maintenance is aging (last release 368 days ago, last commit 2025-09-09), but the repository is active and not archived; suitable for stable, mature use cases where frequent updates are not expected.
License in practice
Apache-2.0 (permissive) allows commercial and private use with minimal restrictions; safe for most projects.
Quickstart
pip install fasteners
import fasteners
lock = fasteners.InterProcessLock('path/to/lock.file')
with lock:
pass # exclusive access
Verify before relying
- Whether ReaderWriterLock works correctly with eventlet or other non-standard threading implementations without custom thread identification functions.
- Performance characteristics under high contention or with many concurrent readers/writers.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 368 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 15,536,221 / month, #1,181 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: Implementation :: PyPyTopic :: Utilities |
Evidence: fasteners-0.20-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “thread synchronization”
- fastenersProvides cross-platform locks for synchronizing access between…
- fastrlockA C-level re-entrant lock for CPython that replaces threading.RLock…
- readerwriterlockProvides reader-writer lock implementations for Python that solve the…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also locket · portalocker · readerwriterlock · fastrlock · lockfile · filelock · aiorwlock · zc.lockfile · fifolock · gilknocker