inotify
An adapter to Linux kernel support for inotify directory-watching.
What it is and what it does
inotify is a Python adapter to the Linux kernel's inotify subsystem, which lets you register directories and receive notifications when files or subdirectories change, create, or delete. Instead of polling directories repeatedly, your code blocks and waits for kernel events, making it far more efficient for file-watching tasks. The library presents events as a generator—you loop through them one at a time, with optional timeouts between cycles, and can optionally receive None values to perform other work between event batches.
The package supports both flat directory watching (via Inotify) and recursive tree watching (via InotifyTree), which automatically manages watches on child directories as they are created. It uses epoll internally to audit kernel events and has been designed to handle Python 3 string/bytes conversions transparently. The library is Linux-only and requires kernel version 2.6 or later.
Use it for:
- Monitor a directory for file uploads or changes and trigger processing pipelines when new files arrive.
- Watch a configuration directory and reload application settings when files are modified.
- Implement a recursive directory watcher to track all file system events in a project tree for backup or sync tools.
- Build a file-system-driven event loop where inotify events drive application logic rather than a timer.
- Detect when log files are rotated or new logs appear and react without polling.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Wraps Linux kernel inotify to watch directories for file system events, yielding them as a generator rather than requiring polling.
Yes, if your application runs on Linux and needs efficient file-system event monitoring. The low install friction, lack of known vulnerabilities, and straightforward generator-based API make it a solid choice for the task. The GPL 2 copyleft license is a hard blocker for proprietary software; open-source projects under compatible licenses should evaluate the aging maintenance status (403 days since last release) and confirm Python version compatibility before committing.
Install
inotify on PyPI
pip
pip install inotifyuv
uv add inotifypoetry
poetry add inotifyInstalling inotify
Before you install
Low friction pure-Python wheel. Maintenance status is aging—last release was 403 days ago—but the repository remains active and unarchived with modest community interest (261 stars).
License in practice
GPL 2 copyleft license. Any application that links this library must be distributed under GPL 2 or a compatible copyleft license; proprietary or permissively-licensed projects cannot use it without legal review.
Quickstart
import inotify.adapters
i = inotify.adapters.Inotify()
i.add_watch('/tmp')
for event in i.event_gen(yield_nones=False):
(_, type_names, path, filename) = event
print(f"PATH=[{path}] FILENAME=[{filename}] EVENT_TYPES={type_names}")
Linux kernel only; inotify is not available on macOS, Windows, or other non-Linux systems.
Verify before relying
- Whether the aging maintenance status (403 days since last release) indicates active stewardship or dormancy risk.
- Python version compatibility—requires_python is unspecified; unclear which Python versions are actually supported.
Package facts
| License | GPL 2 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — build |
| Maintenance | aging — 403 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 393,132/month — #7,000 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: inotify-0.2.12-py2.py3-none-any.whl
Keywords: inotify
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
inotify-simpleA lightweight Python wrapper around the Linux…
permissive · top 5,000 on PyPI
pyinotifyMonitors Linux filesystem events (file…
permissive · top 5,000 on PyPI
asyncinotifyProvides async and sync Python bindings to…
copyleft · top 15,000 on PyPI
watchdogWatchdog monitors file system events across…
permissive · top 1,000 on PyPI
watchgodWatches a directory for file changes and…
permissive · top 15,000 on PyPI
watchfilesWatches file system changes and triggers…
permissive · top 1,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
dirsqlWatches a local directory, indexes structured…
permissive · top 15,000 on PyPI
memory-tempfileIdentifies and provides access to RAM-based…
permissive · top 15,000 on PyPI