asyncinotify
'A simple optionally-async python inotify library, focused on simplicity of use and operation, and leveraging modern Python features
What it is and what it does
asyncinotify wraps the Linux inotify API into a straightforward async/sync Python interface using ctypes, with no external C dependencies. It exposes filesystem events (file creation, deletion, modification, attribute changes, moves) through an async iterator or synchronous polling, with paths represented as pathlib Path objects and event masks as Python IntFlags for readable introspection.
The library prioritizes simplicity and Pythonic design over feature bloat: the core Inotify class handles the essential watch-and-iterate pattern, while optional features like recursive directory watching are implemented as separate classes. It caches events in bulk for minor performance gains and supports Python 3.6 through 3.14, making it suitable for long-running daemons, build tools, and development utilities that need to react to filesystem changes.
Use it for:
- Monitor a directory for new files and trigger processing pipelines when they arrive.
- Watch configuration files and reload application state when they change.
- Implement a file-based job queue or watch folder system.
- Build development tools that rebuild or restart services on source code changes.
- Track filesystem activity for audit or debugging purposes in long-running services.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides async and sync Python bindings to Linux inotify for monitoring filesystem events, with no external dependencies and a simple, Pythonic API.
Yes. Zero dependencies, active maintenance, no known vulnerabilities, and a clean async API make it the right choice for any Python project needing inotify on Linux. The MPL-2.0 license is permissive for library use. Install friction is negligible and the codebase is intentionally simple to understand and modify.
Install
asyncinotify on PyPI
pip
pip install asyncinotifyuv
uv add asyncinotifypoetry
poetry add asyncinotifyInstalling asyncinotify
Before you install
Low friction: pure Python wheel with zero runtime dependencies. Actively maintained as of 2026-05-28 with regular releases.
License in practice
MPL-2.0 copyleft license explicitly compatible with secondary licenses; you can use it as a library without license concerns unless your own license is incompatible.
Quickstart
pip install asyncinotify
from asyncinotify import Inotify, Mask
import asyncio
async def main():
with Inotify() as inotify:
inotify.add_watch('/tmp', Mask.CREATE | Mask.DELETE)
async for event in inotify:
print(event)
asyncio.run(main())
Requires Linux with inotify support; FreeBSD 15+ and z/OS 2.5+ have partial/experimental support.
Verify before relying
- Whether ctypes-based inotify binding has performance overhead compared to C extensions in high-event-rate scenarios.
- Exact scope of FreeBSD 15+ and z/OS 2.5+ support and whether they are tested in CI.
Package facts
| License | MPL-2.0 (copyleft) |
| Python support | supports the current Python release (<4,>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 123 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 582,656/month — #5,899 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: asyncinotify-4.4.4-py3-none-any.whl
Keywords: async, inotify
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 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
inotifyWraps Linux kernel inotify to watch directories…
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
pywatchmanpywatchman is a Python client for Watchman, a…
permissive · top 15,000 on PyPI
watchfilesWatches file system changes and triggers…
permissive · top 1,000 on PyPI
django-watchfilesReplaces Django's default file-change watcher…
permissive · top 15,000 on PyPI
pyobjc-framework-FSEventsProvides Python bindings to macOS's FSEvents…
permissive · top 15,000 on PyPI
pytest-watcherAutomatically reruns pytest (or another test…
permissive · top 5,000 on PyPI