Registry /
type-stubs / pyobjc-framework-screencapturekit
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
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ScreenCaptureKit
✓ import ScreenCaptureKit
SCShareableContent
✓ from ScreenCaptureKit import SCShareableContent
This quickstart demonstrates how to list available screen capture content (applications, displays, windows) using `SCShareableContent`. Note that running this code requires 'Screen Recording' permissions to be granted to your Python environment in macOS System Settings > Privacy & Security. Asynchronous operations in `ScreenCaptureKit` require the `NSRunLoop` to be active for completion handlers to execute.
import ScreenCaptureKit
from Foundation import NSLog, NSDate
import objc
# Define a completion handler for the asynchronous call
def completion_handler(content, error):
if error:
NSLog("Error getting shareable content: %@", error)
elif content:
NSLog("Successfully retrieved shareable content:")
NSLog("Applications: %s", content.applications())
NSLog("Displays: %s", content.displays())
NSLog("Windows: %s", content.windows())
else:
NSLog("No content or error.")
# Asynchronously get available screen capture content
# Note: This requires 'Screen Recording' permission in macOS System Settings.
ScreenCaptureKit.SCShareableContent.getShareableContentWithCompletionHandler_(completion_handler)
# Keep the runloop active briefly for the completion handler to execute.
# In a full Cocoa application, this would be handled by the app's main runloop.
objc.currentEventLoop().runUntilDate_(NSDate.dateWithTimeIntervalSinceNow_(2))
Debug
Known issues
breakingPython 3.9 support was dropped in PyObjC 12.0. PyObjC 11.0 also dropped support for Python 3.8. Ensure your Python version meets the `pyobjc` requirements (currently Python >=3.10).fixUpgrade your Python environment to 3.10 or later.
affects: 11.0, 12.0
breakingThe core bridge's behavior for initializer methods (e.g., `init` family) was aligned with `clang`'s Automatic Reference Counting documentation. This change in object lifecycle management can cause subtle reference counting issues in existing code that relied on the previous PyObjC behavior.fixReview code involving object creation and initialization, especially where references are passed or returned, to ensure correct memory management under the new ARC semantics.
affects: 11.1 and later
gotchaAccessing ScreenCaptureKit functionalities requires explicit 'Screen Recording' permissions in macOS System Settings > Privacy & Security. Without this permission, API calls may return errors or empty results.fixGrant 'Screen Recording' permission to the Python application or terminal running the script in macOS System Settings.
affects: All versions
gotchaPyObjC, including `ScreenCaptureKit` bindings, is fundamentally a macOS-only library due to its reliance on Apple's Cocoa and Foundation frameworks. It will not run on other operating systems.fixEnsure the application is deployed and run exclusively on macOS environments.
affects: All versions
gotchaFree-threading (PEP 703) in Python 3.13 is experimentally supported as of PyObjC 11.0. Older versions (e.g., PyObjC 10.3) explicitly stated no support for it. While experimental support exists, be aware of potential instabilities or unexpected behavior when using PyObjC in a free-threaded Python environment.fixIf encountering issues, consider using a non-free-threaded Python 3.13 build or a Python 3.12 environment until free-threading support in PyObjC matures.
affects: 10.3 (no support), 11.x (experimental support)
gotchaMany ScreenCaptureKit operations are asynchronous, relying on completion handlers or delegates. For these handlers to execute, the macOS `NSRunLoop` must be active. In simple scripts, you might need to manually run `objc.currentEventLoop().runUntilDate_(...)` to allow callbacks to process.fixEnsure the `NSRunLoop` is active when performing asynchronous operations, either by running an application's main loop or explicitly running `objc.currentEventLoop()` for a duration.
affects: All versions
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredCore PyObjC bridge functionality