Registry / type-stubs / pyobjc-framework-screencapturekit

pyobjc-framework-screencapturekit

JSON →
library12.2pypypiunverified

PyObjC-framework-ScreenCaptureKit provides Python bindings for Apple's ScreenCaptureKit framework on macOS. It enables Python applications to interact with macOS screen recording functionalities. This library is part of the larger PyObjC project, receiving updates in sync with macOS SDK changes and Python versions. The current version is 12.1, released with a focus on macOS SDK updates and Python 3.10+ compatibility.

pip install pyobjc-framework-screencapturekit
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-S
P
pyobjc-framework-screencapturekit
type-stubspythonv12.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.

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).
fix
Upgrade 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.
fix
Review 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.
fix
Grant '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.
fix
Ensure 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.
fix
If 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.
fix
Ensure 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
Agent activity
61 hits · last 30 days
node
56
OpenAI (training)
2
Resources
pyobjc-framework-screencapturekit — pip install pyobjc-framework-screencapturekit · libregistry