Watchdog is a Python library and shell utility to monitor filesystem events.
The tool solves the problem of detecting and responding to file system changes across different operating systems. It provides a unified API that abstracts away platform-specific details, allowing developers to write filesystem monitoring code once and have it work consistently. The core approach uses an Observer pattern where event handlers are registered for specific directories, and the observer detects changes like file creation, modification, and deletion, then dispatches them to registered handlers.
Watchdog suits projects that need to react to filesystem changes, such as build systems, file synchronization tools, development servers that reload on file changes, or backup utilities. The library works on Python 3.9 and later. Beyond the Python API, the tool includes optional shell utilities called watchmedo that enable filesystem monitoring and command execution from the command line without writing code, making it accessible for scripting and automation tasks. The watchmedo tool supports pattern matching to filter events by file type and can execute arbitrary shell commands in response to filesystem events.
The project maintains a steady stream of commits addressing bug fixes and feature requests, with regular engagement on issues and pull requests. Development activity shows consistent attention to cross-platform compatibility and reliability improvements. The maintainer actively solicits community support for continued development of the project.