Registry / serialization / pyobjc-framework-photos

pyobjc-framework-photos

JSON →
library12.2.2pypypiunverified

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-photos
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-P
P
pyobjc-framework-photos
serializationpythonv12.2.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.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

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

Photos
import Photos
objc
import objc

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.

import Photos import objc def list_some_photo_data(): # All Cocoa calls must be made within an autorelease pool pool = objc.autorelease_pool() try: # Check authorization status for Photos access status = Photos.PHPhotoLibrary.authorizationStatus() if status == Photos.PHAuthorizationStatusAuthorized: print("Photos access is authorized.") # Fetch all user albums user_albums = Photos.PHAssetCollection.fetchAssetCollectionsWithType_subtype_options_( Photos.PHAssetCollectionTypeAlbum, Photos.PHAssetCollectionSubtypeAny, None ) print(f"Found {user_albums.count()} user albums:") for i in range(min(3, user_albums.count())): # List up to 3 albums album = user_albums.objectAtIndex_(i) print(f"- {album.localizedTitle()}") elif status == Photos.PHAuthorizationStatusLimited: print("Photos access is limited (user selected specific photos).") # Can still fetch, but only for selected photos else: print(f"Photos access is not authorized. Current status: {status}") print("Please ensure your application (or terminal) has Photos access granted in System Settings > Privacy & Security > Photos.") finally: # The pool must be released del pool if __name__ == '__main__': list_some_photo_data()
Debug
Known issues
breakingPyObjC 12.0 dropped support for Python 3.9. PyObjC 11.0 dropped support for Python 3.8. The latest versions require Python 3.10 or later.
fix
Ensure your Python environment is 3.10 or newer. Upgrade Python if necessary.
affects: 12.0+
gotchaPyObjC (and thus `pyobjc-framework-photos`) is a macOS-specific library. It provides bindings to Apple's Objective-C frameworks, which are only available on macOS.
fix
Only use this library on macOS systems. Cross-platform applications requiring photo access will need alternative solutions for non-macOS platforms.
affects: All versions
breakingPyObjC 11.1 introduced significant changes to how initializer methods are modeled, aligning with `clang`'s automatic reference counting (ARC) documentation. Custom `init` methods in Python subclasses might behave differently regarding reference counting.
fix
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.
affects: 11.1+
gotchaExperimental free-threading support (PEP 703) in Python 3.13 is *not* fully supported by PyObjC. While PyObjC 11.0 introduced *experimental* support, there may still be stability or performance issues when running with free-threading enabled.
fix
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.
affects: 11.0+
Upgrade
Version history
12.2.2latest on PyPI · released Aug 11, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
pyobjc-framework-photos — pip install pyobjc-framework-photos · libregistry