{"library":"pyobjc-framework-intents","title":"PyObjC Intents Framework","description":"PyObjC-framework-intents provides Python wrappers for Apple's Intents framework on macOS, enabling developers to integrate Python applications with system services like Siri and Shortcuts. It is part of the larger PyObjC project, a bridge between Python and Objective-C. The library is actively maintained, with releases often coinciding with new macOS SDK updates to ensure compatibility and introduce new features.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-intents"],"cli":null},"imports":["from Intents import INIntent"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from Intents import INIntent\nfrom Foundation import NSObject\nimport objc\n\n# PyObjC often requires an application context for full functionality.\n# This is a minimal example demonstrating class access.\n\n# Instantiate a basic INIntent object (typically a subclass would be used)\n# Note: Actual use of Intents often involves a complex app setup and definition\n# through Xcode's project capabilities for proper system integration.\n\ntry:\n    # Attempt to create a generic INIntent instance\n    # In a real scenario, you'd subclass INIntent or use a specific IN*Intent class\n    intent = INIntent.alloc().init()\n    print(f\"Successfully created INIntent instance: {intent}\")\n    print(f\"Intent identifier: {intent.identifier()}\")\nexcept objc.nosuchclass_error:\n    print(\"Intents framework classes are not available or Intents is not properly linked.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n# Example of how to define a simple Python class that could interact with Intents\n# (though direct INIntent subclassing in Python for full functionality might be limited\n# without Xcode-generated intent definitions)\n\nclass MySimpleIntentHandler(NSObject):\n    def init(self):\n        self = super().init()\n        if self is None:\n            return None\n        print(\"MySimpleIntentHandler initialized.\")\n        return self\n\n    @objc.python_method\n    def handleMyCustomIntent_(self, intent):\n        print(f\"Handling custom intent: {intent.identifier()}\")\n        # In a real app, this would process the intent\n        return None # Or return an INIntentResponse\n\n\nif __name__ == '__main__':\n    # This part would usually run within an application main loop (e.g., AppKit.NSApplication.sharedApplication().run())\n    # For a simple script, it demonstrates object creation.\n    handler = MySimpleIntentHandler.alloc().init()\n    # Simulate calling the handler with a basic intent (won't actually do anything useful without a real intent from the system)\n    # For demonstration, we'll create a dummy INIntent\n    dummy_intent = INIntent.alloc().init()\n    dummy_intent.setValue_forKey_(f\"com.example.myintent.{id(dummy_intent)}\", \"identifier\") # Set a dummy identifier\n    handler.handleMyCustomIntent_(dummy_intent)\n","lang":"python","description":"This quickstart demonstrates how to import a class from the `Intents` framework and instantiate a basic `INIntent` object using PyObjC. Full integration with Apple's Intents system (e.g., for Siri or Shortcuts) typically requires defining and configuring intents within an Xcode project and running within an application context. The example also shows a minimal Objective-C class definition pattern in Python.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"12.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyobjc-framework-intents","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.5,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}