watchgod
Simple, modern file watching and code reload in python.
What it is and what it does
watchgod is a file-watching library that monitors a directory tree for changes and can either report those changes to your code or automatically restart a process when files are modified. It provides both synchronous (watch, run_process) and asynchronous (awatch, arun_process) APIs, plus a CLI tool for reloading Python applications during development. The library uses polling rather than OS-level file notifications, which trades some latency for simplicity and cross-platform consistency.
The package depends only on anyio for async support and works across Python 3.7+. However, it has been superseded by a newer package with the same author that uses a different backend for better performance. watchgod is now in maintenance mode and will not receive new features—only critical security fixes.
Use it for:
- Auto-reloading a development web server when Python source files change in the project directory.
- Triggering test runs or linting checks whenever code is modified during active development.
- Building custom file-monitoring tools that need to react to filesystem changes with custom callbacks.
- Watching for changes to configuration or data files and reloading an application in response.
- Implementing a CLI tool that restarts a subprocess when any file in a directory tree is modified.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Watches a directory for file changes and triggers code reloads or custom callbacks when files are modified, with both synchronous and asynchronous APIs.
No—the package is no longer actively developed and has been renamed. Unless you have an existing dependency or a specific reason to avoid migration, use the successor package instead. If you are already using watchgod, plan a migration; the package will only receive critical security fixes.
Install
watchgod on PyPI
pip
pip install watchgoduv
uv add watchgodpoetry
poetry add watchgodInstalling watchgod
Before you install
Low install friction with a single runtime dependency (anyio). However, the package is no longer actively developed—it was renamed and will only receive critical security fixes going forward.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install watchgod
from watchgod import watch
for changes in watch('./path/to/dir'):
print(changes)
Verify before relying
- Whether the package's polling-based approach meets performance requirements for your specific use case.
- Current state of the migration path and compatibility with the successor package.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — anyio |
| Maintenance | actively maintained — 1,596 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 790,764/month — #5,050 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: watchgod-0.8.2-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
hupperHupper monitors Python source files for changes…
permissive · top 5,000 on PyPI
watchfilesWatches file system changes and triggers…
permissive · top 1,000 on PyPI
juriggedJurigged lets you edit and hot-patch Python…
permissive · top 15,000 on PyPI
pywatchmanpywatchman is a Python client for Watchman, a…
permissive · top 15,000 on PyPI
django-watchfilesReplaces Django's default file-change watcher…
permissive · top 15,000 on PyPI
httpwatcherhttpwatcher is a simple HTTP server and library…
permissive · top 15,000 on PyPI
asyncinotifyProvides async and sync Python bindings to…
copyleft · top 15,000 on PyPI
pyinotifyMonitors Linux filesystem events (file…
permissive · top 5,000 on PyPI
inotifyWraps Linux kernel inotify to watch directories…
copyleft · top 15,000 on PyPI
pytest-watcherAutomatically reruns pytest (or another test…
permissive · top 5,000 on PyPI