PyObjC Framework FileProviderUI

12.1 · active · verified Tue Apr 14

PyObjC is a bidirectional bridge between Python and Objective-C, enabling Python scripts to use and extend macOS's Cocoa frameworks. `pyobjc-framework-fileproviderui` provides Python wrappers for the `FileProviderUI` framework on macOS, allowing developers to interact with File Provider UI extensions. The PyObjC project, including this framework wrapper, maintains an active development cycle with frequent minor releases and major versions often aligning with new macOS SDKs.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the `FileProviderUI` framework and access a common class, `FPUIActionExtensionContext`, to print its description. This verifies the successful loading and bridging of the framework. This script should be run on macOS.

import FileProviderUI
import Foundation # Often needed for basic Cocoa objects like NSString, NSObject

def main():
    print(f"FileProviderUI module loaded: {FileProviderUI}")
    # Try to access a known class from the framework and print its description
    # FPUIActionExtensionContext is a common class in FileProviderUI
    if hasattr(FileProviderUI, 'FPUIActionExtensionContext'):
        context_class = FileProviderUI.FPUIActionExtensionContext
        print(f"FPUIActionExtensionContext class: {context_class}")
        print(f"Description of FPUIActionExtensionContext: {context_class.description()}")
    else:
        print("FPUIActionExtensionContext not found. This might indicate an older macOS SDK or an internal API.")

if __name__ == "__main__":
    main()

view raw JSON →