Comparison
fasteners vs filelock vs lockfile vs portalocker
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
A python package that provides useful locks
Low maintenance activity. Last release 16 months ago, commits in 1 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install fastenersA platform independent file lock.
Actively maintained. Last release 5 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install filelockPlatform-independent file locking module
Likely abandoned. No release or commit for years (last release over 11 years ago).
pip install lockfileCross-platform file locking, with Redis, PID-file and bounded-semaphore locks
Actively maintained. Last release 5 weeks ago, commits in 13 of the last 26 weeks. A safe choice.
pip install portalockerIn short
- lockfile looks abandoned: avoid it for new projects.
- filelock is the most used: 628.5M downloads a month, 13× more than portalocker.
- Maintenance is comparable: portalocker 85, filelock 80, fasteners 24 on Pythie’s Index.
- Safe default for a new project: filelock.
Side by side
| Metric | fasteners | filelock | lockfile | portalocker |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 24 | 80 |