// the find
samuelcolvin/watchfiles
Simple, modern and fast file watching and code reload for Python, written in Rust
watchfiles is a Python file-watching library backed by the Rust `notify` crate, giving you OS-native filesystem events (inotify, FSEvents, ReadDirectoryChangesW) without the overhead of pure-Python polling. It covers both sync and async use cases and ships prebuilt wheels, so most users never touch Rust. If you run uvicorn or any ASGI server in dev mode, you're probably already using this — it's the default watcher for uvicorn.
The Rust backend means latency is in the low milliseconds on Linux inotify instead of the seconds you get from polling. Both sync (`watch`) and async (`awatch`) iterators are first-class, not bolted on — the async path integrates cleanly with asyncio without spawning a thread-per-directory. The filter API is practical: you can pass a callable or use the built-in `PythonFilter`/`DefaultFilter` to skip `.pyc`, `__pycache__`, and `.git` noise without writing your own exclusion logic. Prebuilt wheels cover x86_64 and aarch64 on Linux/macOS/Windows, so the Rust dependency is invisible to most users.
The public API is intentionally minimal, which means no built-in debouncing — if a tool writes a file in multiple steps you'll get multiple events and need to handle coalescing yourself. The `run_process` / `arun_process` reloader is convenient for simple scripts but lacks the module-level hot-reload semantics that something like `jurigged` offers; it restarts the whole process, which is slow for heavy apps. Remote/network filesystem support is effectively undefined — notify's kernel-event path won't fire on NFS or SMB mounts without polling fallback, and watchfiles doesn't document when that fallback kicks in or how to force it. Stars (2.5k) are modest for a library this foundational; it's well-maintained by the pydantic/fastapi author but community issue velocity is low.