{"library":"pyobjc-framework-photosui","title":"PyObjC PhotosUI Framework","description":"pyobjc-framework-photosui provides Python bindings for Apple's PhotosUI framework on macOS, allowing Python developers to interact with system-level Photos user interface components. It is part of the larger PyObjC project, which acts as a bridge between Python and Objective-C. The library is actively maintained, with version 12.1 being the latest stable release, and it generally releases new versions in conjunction with major macOS SDK updates.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-photosui"],"cli":null},"imports":["import PhotosUI"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import PhotosUI\nimport Foundation\nimport AppKit\n\n# Most PhotosUI interactions require a running Cocoa application.\n# This snippet demonstrates basic import and class access.\n# For a functional UI example, a full PyObjC app setup with NSApplication is required.\n\ndef main():\n    # Initialize a basic NSApplication (required for most Cocoa frameworks)\n    app = AppKit.NSApplication.sharedApplication()\n    \n    # Access a PhotosUI class to confirm the framework is loaded\n    try:\n        # PHLivePhotoView is a common PhotosUI class introduced in iOS/macOS 10.11\n        _ = PhotosUI.PHLivePhotoView\n        print(\"Successfully imported PhotosUI and accessed PHLivePhotoView.\")\n    except AttributeError:\n        print(\"Could not access PHLivePhotoView. Ensure macOS version supports PhotosUI and PyObjC is correctly installed.\")\n    \n    # Note: A real PhotosUI application would involve delegates, windows, and an event loop.\n    # app.run() # This would start the GUI event loop, blocking further execution.\n\nif __name__ == '__main__':\n    main()","lang":"python","description":"This quickstart demonstrates how to import the `PhotosUI` framework and access a class within it. Most `PhotosUI` functionalities require a running Cocoa application, typically managed via `AppKit.NSApplication`. This snippet initializes the shared application (without starting its run loop) and attempts to access `PHLivePhotoView` to confirm the bindings are loaded. Full UI interactions would require more extensive setup.","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-photosui","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-photosui","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.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-photosui","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-photosui","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-photosui","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-photosui","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-photosui","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-photosui","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.5,"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-photosui","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-photosui","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.4,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}