Simple, modern and high performance file watching and code reload in python.
Maintained. Last release 2 months ago, commits in 4 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install watchfileswatchfiles
Simple, modern and high performance file watching and code reload in python.
Documentation: watchfiles.helpmanual.io
Source Code: github.com/samuelcolvin/watchfiles
Underlying file system notifications are handled by the Notify rust library.
This package was previously named "watchgod", see the migration guide for more information.
Installation
watchfiles requires Python 3.10 - 3.15.
pip install watchfiles
Binaries are available for most architectures on Linux, MacOS and Windows (learn more).
Otherwise, you can install from source which requires Rust stable to be installed.
Usage
Here are some examples of what watchfiles can do:
watch Usage
from watchfiles import watch
for changes in watch('./path/to/dir'):
print(changes)
See watch docs for more details.