This library provides Python wrappers for the macOS FSEvents framework, allowing applications to monitor file system events efficiently. It is part of the larger PyObjC project, which bridges Python and the Objective-C runtime on macOS. The project follows macOS SDK updates closely, often releasing new versions with each major OS release, and is currently at version 12.1.
pip install pyobjc-framework-fseventsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `pyobjc-framework-fsevents` to monitor a specified directory for file system events. It sets up an `FSEventStream` with a Python callback function and schedules it on the current thread's `CFRunLoop`. It will monitor for 30 seconds or until a `KeyboardInterrupt` occurs. Remember that `pyobjc-framework-fsevents` is macOS-specific.
Upgrade your Python environment to 3.10 or newer, or pin your `pyobjc-framework-fsevents` dependency to `<12.0`.
Upgrade your Python environment to 3.9 or newer (for PyObjC 11.x) or 3.10+ (for PyObjC 12.x), or pin `pyobjc-framework-fsevents` to `<11.0`.
Review custom Objective-C class wrappers and memory management logic, especially around `init` methods, to ensure they correctly handle ARC semantics. Most Python-only code should be unaffected.
Develop and deploy applications using PyObjC exclusively on macOS environments. Consider platform-agnostic alternatives if cross-platform compatibility is required.
When subclassing Cocoa classes in Python, prefer to implement initialisation logic directly in the `__new__` method or by calling designated Objective-C initializers after object creation, rather than relying on Python's `__init__` for complex setup.