skillfed

asyncinotify

'A simple optionally-async python inotify library, focused on simplicity of use and operation, and leveraging modern Python features

asyncinotify v4.4.4 582.7K downloads/30d#5,899 on PyPI47
Copyleft license MPL-2.0 Active released

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 asyncinotify

uv

uv add asyncinotify

poetry

poetry add asyncinotify

Installing 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

Development Status :: 6 - MatureFramework :: AsyncIOIntended Audience :: DevelopersOperating System :: POSIX :: BSD :: FreeBSDOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

async filesystem monitoringinotify python libraryfile system event watchinglinux file change detectionasync file watcherdirectory monitoring asyncfilesystem event listener
async-iofilesystem-eventslinux-native

More Libraries packages