skillfed

inotify-simple

A simple wrapper around inotify. No fancy bells and whistles, just a literal wrapper with ctypes. Under 100 lines of code!

inotify-simple v2.0.1 1.8M downloads/30d#3,541 on PyPI134
Permissive license BSD-2-Clause AGING released

What it is and what it does

inotify-simple is a minimal, pure-Python wrapper around the Linux inotify system call. It exposes inotify's core functionality—initializing a watch, adding/removing watched paths, and reading file system events—through a file-like object and namedtuple event objects, without adding abstraction layers or convenience features. The implementation uses ctypes to call the underlying C library, keeping the code under 100 lines and avoiding compiled dependencies.

You use it to monitor directories and files for changes (creation, deletion, modification, etc.) on Linux systems. It is designed for developers who want direct, low-level access to inotify semantics rather than a high-level abstraction; you manage watch descriptors yourself and interpret event masks using the provided flags enum.

Use it for:

  • Monitor a directory for new files and trigger processing when they appear.
  • Track modifications to configuration files and reload application state on change.
  • Build a file watcher tool that reports file system events in real-time.
  • Implement cleanup logic when watched directories or files are deleted.
  • Debug file system activity by logging all events on a watched path.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A lightweight Python wrapper around the Linux inotify API for monitoring file system events, implemented in pure Python with ctypes and minimal code.

Yes, if you need file system event monitoring on Linux and prefer a minimal, dependency-free solution. The pure-Python implementation and explicit design philosophy for long-term stability make it reliable for straightforward use cases. Not suitable for Windows or macOS, and the aging maintenance status is normal by design—choose it when you want simplicity over active feature development.

Install

inotify-simple on PyPI

pip

pip install inotify-simple

uv

uv add inotify-simple

poetry

poetry add inotify-simple

Installing inotify-simple

Before you install

Low friction: pure Python wheel with no runtime dependencies. Maintenance status is aging—last release 354 days ago—but the project explicitly states it requires minimal maintenance by design and the repository remains active.

License in practice

BSD-2-Clause is permissive; you may use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.

Quickstart

from inotify_simple import INotify, flags

inotify = INotify()
wd = inotify.add_watch('/tmp/test', flags.CREATE | flags.MODIFY)
for event in inotify.read():
    print(event)

Linux only; inotify is not available on Windows or macOS. Requires Python 3.6 or higher.

Verify before relying

  • Whether the ctypes wrapper fully covers all inotify features or only a subset of the C API.
  • Performance characteristics under high-frequency file system event loads compared to alternatives.

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 354 days since the last release
Last repo commit
First released
Downloads 1,802,132/month — #3,541 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: inotify_simple-2.0.1-py3-none-any.whl

Keywords: inotify

Tags

file system event monitoringinotify wrapper pythonlinux file change detectiondirectory watch eventsfile modification trackingctypes inotify binding
file-monitoringlinux-only

More Monitoring packages