Registry / pyobjc-framework-photosui

pyobjc-framework-photosui

JSON →
library12.2pypypiunverified

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.

pip install pyobjc-framework-photosui
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-P
P
pyobjc-framework-photosui
pythonv12.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PhotosUI
import PhotosUI
The PhotosUI framework is exposed directly as a Python package.

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.

import PhotosUI import Foundation import AppKit # Most PhotosUI interactions require a running Cocoa application. # This snippet demonstrates basic import and class access. # For a functional UI example, a full PyObjC app setup with NSApplication is required. def main(): # Initialize a basic NSApplication (required for most Cocoa frameworks) app = AppKit.NSApplication.sharedApplication() # Access a PhotosUI class to confirm the framework is loaded try: # PHLivePhotoView is a common PhotosUI class introduced in iOS/macOS 10.11 _ = PhotosUI.PHLivePhotoView print("Successfully imported PhotosUI and accessed PHLivePhotoView.") except AttributeError: print("Could not access PHLivePhotoView. Ensure macOS version supports PhotosUI and PyObjC is correctly installed.") # Note: A real PhotosUI application would involve delegates, windows, and an event loop. # app.run() # This would start the GUI event loop, blocking further execution. if __name__ == '__main__': main()
Debug
Known issues
breakingPython 3.9 support was dropped in PyObjC 12.0. Python 3.8 support was dropped in PyObjC 11.0.
fix
Upgrade to Python 3.10 or later for PyObjC 12.x, or Python 3.9 or later for PyObjC 11.x. Always use a Python version supported by your PyObjC version.
affects: 11.0, 12.0
breakingPyObjC 11.1 aligned the core bridge's 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.
fix
Existing code should review object instantiation patterns, especially custom subclasses of Objective-C classes, to ensure correct reference handling, though PyObjC manages most ARC complexities internally. This primarily affects advanced users subclassing Objective-C objects.
affects: 11.1 and later
breakingThe interaction between Python's `__init__` and `__new__` methods when subclassing Objective-C classes changed in PyObjC 10.3, leading to breakage for some projects. While partially reverted in 10.3.1, code relying on `__new__` provided by PyObjC cannot use `__init__`.
fix
If implementing `__new__` in a Python subclass of an Objective-C class, ensure `__init__` is not called if `__new__` is meant to handle object initialization entirely, or structure your class hierarchy to avoid conflicts. Refer to PyObjC documentation on object instantiation.
affects: 10.3, 10.3.1
deprecatedThe 'IMServicePlugIn' framework bindings were removed in PyObjC 10.0 as the framework itself was deprecated in macOS 10.13 and removed in macOS 14.
fix
Migrate away from IMServicePlugIn to current Apple APIs if your application relies on this functionality. This warning is specific to the `pyobjc-framework-IMServicePlugIn` package, but is a relevant major version change within the broader PyObjC ecosystem.
affects: 10.0 and later
gotchaPyObjC requires the Xcode Command Line Tools to be installed on macOS for building and sometimes even for installation.
fix
Run `xcode-select --install` in your terminal to ensure the command line tools are present.
affects: All versions
gotchaObjective-C object instantiation is a two-step process (`alloc()` then `init...()`). While PyObjC allows calling the class directly for many cases, understanding this underlying mechanism is crucial for complex or custom object creation.
fix
When `ClassName(...)` doesn't work as expected, explicitly use `ClassName.alloc().init(...)` or `ClassName.alloc().initWithArgument(...)` patterns. Consult Apple's Objective-C documentation for the specific class's initialization methods.
affects: All versions
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredProvides the core bridge between Python and Objective-C, essential for all PyObjC framework wrappers.
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
pyobjc-framework-photosui — pip install pyobjc-framework-photosui · libregistry