{"id":6171,"library":"pyobjc-framework-securityui","title":"PyObjC Framework SecurityUI","description":"PyObjC Framework SecurityUI provides Python bindings for Apple's SecurityUI.framework on macOS. This framework offers user interface components for interacting with security-related authorization services. Version 12.1 is the current release, part of the larger PyObjC project, which generally follows macOS and Python release cycles.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","cocoa","framework","security","ui","pyobjc"],"install":[{"cmd":"pip install pyobjc-framework-securityui","lang":"bash","label":"Install specific SecurityUI bindings"},{"cmd":"pip install pyobjc","lang":"bash","label":"Install all PyObjC core and framework bindings"}],"dependencies":[{"reason":"Required for all PyObjC framework bindings to function.","package":"pyobjc-core","optional":false}],"imports":[{"note":"Commonly used class for managing authorization rights and UI.","symbol":"SFAuthorization","correct":"from SecurityUI import SFAuthorization"}],"quickstart":{"code":"from Foundation import NSBundle\nfrom SecurityUI import SFAuthorization\n\n# This example verifies the SecurityUI framework and a key class are available.\n\n# Check if the framework bundle exists\nsecurity_ui_bundle = NSBundle.bundleWithPath_(\n    '/System/Library/Frameworks/SecurityUI.framework'\n)\nif security_ui_bundle:\n    print(f\"SecurityUI framework bundle found at {security_ui_bundle.bundlePath()}\")\n    print(f\"Framework version: {security_ui_bundle.bundleShortVersionString()}\")\nelse:\n    print(\"SecurityUI framework bundle not found or inaccessible. \"\n          \"Ensure you are running on macOS.\")\n\n# Verify a key class from the framework can be imported and accessed\ntry:\n    auth_class = SFAuthorization\n    print(f\"Successfully imported SFAuthorization class: {auth_class}\")\n    # In a real application, you'd then instantiate and use auth_class\n    # e.g., auth = auth_class.alloc().init()\nexcept NameError:\n    print(\"Failed to import SFAuthorization class from SecurityUI. \"\n          \"Ensure pyobjc-framework-securityui is installed and running on macOS.\")\n","lang":"python","description":"This quickstart demonstrates how to verify the presence of the SecurityUI framework and successfully import a key class (`SFAuthorization`). It confirms the Python bindings are correctly installed and accessible on a macOS system without requiring a full GUI application."},"warnings":[{"fix":"Upgrade to Python >= 3.10 or pin `pyobjc-framework-securityui` to a version `< 12.0`.","message":"PyObjC 12.0 dropped support for Python 3.9. Users on Python 3.9 must remain on PyObjC < 12.0.","severity":"breaking","affected_versions":">=12.0"},{"fix":"Upgrade to Python >= 3.9 or pin `pyobjc-framework-securityui` to a version `< 11.0`.","message":"PyObjC 11.0 dropped support for Python 3.8. Users on Python 3.8 must remain on PyObjC < 11.0.","severity":"breaking","affected_versions":">=11.0"},{"fix":"Review and update code that performs manual reference counting or relies on specific object ownership semantics for `init` methods.","message":"PyObjC 11.1 changed how 'init' family methods handle object references, now correctly stealing a reference to `self` and returning a new one, aligning with `clang` ARC documentation. This may alter object lifecycle management for code relying on previous behavior.","severity":"breaking","affected_versions":">=11.1"},{"fix":"Avoid using `__init__` with custom `__new__` implementations, or carefully manage object creation and initialization to match PyObjC's expectations for `__new__`.","message":"In PyObjC 10.3, calling `__init__` for Python classes that override `__new__` was disabled. While partially reverted in 10.3.1, this can still cause issues if `__new__` is implemented but `__init__` is used with a PyObjC-provided `__new__`.","severity":"gotcha","affected_versions":"10.3 - 10.3.1"},{"fix":"Be aware of the experimental nature of free-threading support. Report any issues encountered to the PyObjC project.","message":"Experimental free-threading support (PEP 703) was introduced in PyObjC 11.0 for Python 3.13. While a significant feature, its 'experimental' status means users should exercise caution and thorough testing.","severity":"gotcha","affected_versions":">=11.0 (with Python 3.13+)"},{"fix":"Manually implement KVO observation for `NSProxy` subclasses if needed, or refactor to avoid relying on automatic KVO for these types.","message":"Automatic Key-Value Observing (KVO) usage for subclasses of `NSProxy` defined in Python is disabled since PyObjC 12.1. This change improves stability but means KVO will not automatically apply to such classes.","severity":"deprecated","affected_versions":">=12.1"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}