PyObjC FSKit Framework
This library provides Python wrappers for the macOS FSKit framework, which is primarily used for developing Finder Sync extensions. It allows Python applications to interact with Finder's UI and filesystem events. The current version is 12.1, and releases typically follow macOS SDK updates, aligning with Apple's development cycles.
Warnings
- breaking Python 3.9 support was dropped in PyObjC 12.0. Ensure your Python environment is 3.10 or newer. Earlier versions (PyObjC 11.0) dropped Python 3.8 support.
- breaking PyObjC 11.1 aligned its behavior with `clang`'s automatic reference counting (ARC) documentation for initializer methods. Methods in the 'init' family now correctly steal a reference to self and return a new reference, which might change memory management expectations for advanced users interacting directly with ObjC `init` patterns.
- gotcha In PyObjC 10.3, calling `__init__` on classes where `__new__` was provided by PyObjC was disabled. This was partially reverted in 10.3.1, reintroducing the ability to use `__init__` when a user implements `__new__`. However, `__init__` still cannot be used when `__new__` is provided by PyObjC and not overridden by the user.
- breaking The `IMServicePlugIn` bindings were entirely removed in PyObjC 10.0, as the framework was deprecated in macOS 10.13 and removed in macOS 14. Any code relying on this framework will fail.
Install
-
pip install pyobjc-framework-fskit
Imports
- FSKit
import FSKit
- FSKExtension
from FSKit import FSKExtension
Quickstart
import FSKit
import objc # Required for objc.lookUpClass
# FSKit is primarily designed for creating Finder Sync extensions on macOS.
# A full functional example requires registering an extension with macOS,
# which is beyond a simple quickstart. This code demonstrates loading
# the framework and accessing a core class.
# Access a known class from the FSKit framework, e.g., FSKExtension
# FSKExtension is the base class for implementing Finder Sync extensions.
FSKExtension_Class = FSKit.FSKExtension
print(f"FSKit module loaded: {FSKit}")
print(f"FSKExtension class type: {type(FSKExtension_Class)}")
print(f"FSKExtension inherits from NSObject: {issubclass(FSKExtension_Class, objc.lookUpClass('NSObject'))}")
# To actually use FSKit, you would typically subclass FSKExtension, implement
# its methods, and configure your macOS application's Info.plist to register
# it as a Finder Sync extension. This process requires Xcode and specific
# application bundling and is not shown here.