This library provides Python wrappers for the Photos framework on macOS, allowing Python applications to interact with the user's photo library. It's part of the larger PyObjC project, enabling access to Objective-C frameworks from Python. The current version is 12.1 and follows the PyObjC project's release cadence, often aligning with macOS SDK updates and Python version support.
pip install pyobjc-framework-photosVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to check Photos library authorization and list the titles of a few user-created albums. This code must be run on macOS. You might need to grant your Python environment (e.g., Terminal.app or your IDE) access to Photos via System Settings > Privacy & Security > Photos.
Ensure your Python environment is 3.10 or newer. Upgrade Python if necessary.
Only use this library on macOS systems. Cross-platform applications requiring photo access will need alternative solutions for non-macOS platforms.
Review custom Python `init` methods for Objective-C classes, especially regarding ownership and reference counts. Test your application thoroughly after upgrading to 11.1 or later if you have such methods.
If using Python 3.13 with PyObjC, be aware that free-threading support is experimental. Monitor PyObjC release notes for updates on stability. For critical applications, consider using Python 3.12 or earlier until free-threading support is mature.
No dependency data recorded yet.