# filelock

> Platform-independent file locking for Python, for coordinating processes

Source: https://talira.ai/catalog/filelock-h82em71g
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / concurrency](https://talira.ai/categories/libraries/concurrency), [libraries / filesystem](https://talira.ai/categories/libraries/filesystem), [languages / python](https://talira.ai/categories/languages/python)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^1]
- Backed by: [tox-dev](https://talira.ai/orgs/tox-dev.md)

filelock is a Python library from the tox-dev project for locking files across processes on any platform. FileLock picks a native locking backend where one exists and a soft marker file otherwise, with cancellable acquire and self-deadlock detection. It also has SoftFileLock and StrictSoftFileLock for shared filesystems, SoftFileLease for expiring claims with a heartbeat, ReadWriteLock (SQLite-backed, many readers and one writer) and SoftReadWriteLock, and async variants of each.

## Links

- GitHub: https://github.com/tox-dev/filelock
- Docs: https://py-filelock.readthedocs.io/

## Problems it solves

- stop two Python processes writing the same file at once
- make sure only one copy of my Python script runs at a time
- coordinate readers and a writer of a shared file between Python processes

## Features

- FileLock with native backends and a soft fallback
- cancellable acquire and self-deadlock detection
- soft and strict soft locks for shared filesystems
- expiring leases with a heartbeat
- SQLite-backed reader-writer lock
- async variants

## Trust

Overall: 0.62 out of 1.
Signals: maintenance 1.00, adoption 0.60, momentum 0.26, community 0.81, backing 0.30, extensibility 0.00.

- last commit 2 days ago
- 333 commits in the last 90 days
- latest release 4.3.2 2 days ago
- 991 GitHub stars
- 104 contributors
- accepts sponsorship (Github, Tidelift, Thanks Dev)
- backed by tox-dev

## Sources

[^1]: https://github.com/tox-dev/filelock/blob/main/LICENSE (checked 29 Nov 2026)
