Comparison
filelock vs lockfile vs portalocker vs zc.lockfile
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
A 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 14 of the last 26 weeks. A safe choice.
pip install portalockerBasic inter-process locks
Maintained. Last release 4 weeks ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install zc-lockfileIn short
- lockfile looks abandoned: avoid it for new projects.
- filelock is the most used: 638.8M downloads a month, 13× more than portalocker.
- Maintenance is comparable: portalocker 85, filelock 80, zc.lockfile 58 on Pythie’s Index.
- filelock is growing fastest: downloads +12% over the last month.
- Safe default for a new project: filelock.
Side by side
| Metric | filelock | lockfile | portalocker | zc.lockfile |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 80 | 19 |