Registry / pyobjc-framework-screensaver
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.
ScreenSaver
✓ import ScreenSaver
✗ from pyobjc_framework_screensaver import ScreenSaver
PyObjC framework bindings are typically imported directly by their framework name (e.g., 'ScreenSaver'), not from their PyPI package name.
This quickstart demonstrates how to import the ScreenSaver framework and access a core class like `SSScreenSaverView`. While it shows basic instantiation, developing a functional screensaver requires subclassing `SSScreenSaverView` and integrating within a proper macOS screensaver project structure.
import ScreenSaver
import objc
from Foundation import NSMakeRect, NSObject # Needed for basic Cocoa types
# Get a reference to the SSScreenSaverView class
SSScreenSaverView = ScreenSaver.SSScreenSaverView
print(f"Successfully imported ScreenSaver.SSScreenSaverView: {SSScreenSaverView}")
print(f"Is SSScreenSaverView an Objective-C class? {objc.is_objc_class(SSScreenSaverView)}")
# To demonstrate basic instantiation (requires Cocoa types like NSRect)
# Note: A functional screensaver requires proper macOS application context.
try:
dummy_frame = NSMakeRect(0, 0, 100, 100)
# Instantiate an SSScreenSaverView; this will create the Objective-C object.
# It won't be visible or functional without being added to a view hierarchy.
saver_view = SSScreenSaverView.alloc().initWithFrame_isPreview_(dummy_frame, False)
print(f"Created a dummy SSScreenSaverView instance: {saver_view}")
# In a real screensaver, you would subclass SSScreenSaverView and override
# methods like 'drawRect_' or 'animateOneFrame'.
except Exception as e:
print(f"Could not fully instantiate SSScreenSaverView in this context: {e}")
Debug
Known issues
breakingPyObjC 12.x (and thus `pyobjc-framework-screensaver` 12.x) dropped support for Python 3.9. Earlier PyObjC versions (11.x) dropped support for Python 3.8.fixEnsure your Python environment is 3.10 or newer to use the latest versions of PyObjC and its framework bindings.
affects: pyobjc-framework-screensaver 12.0+
gotchaWhen subclassing Objective-C classes in Python, if your class relies on PyObjC's default `__new__` method for Objective-C object creation, you cannot define a traditional Python `__init__` method. Initialization logic should typically be handled within `__new__` or an Objective-C style initializer method.fixIf custom initialization is needed for Objective-C instances, either implement your own `__new__` method or define Objective-C style initializer methods (e.g., `initWithName_`) and expose them via PyObjC.
affects: pyobjc-framework-screensaver 10.3+
gotchaPyObjC 11.1 introduced changes to align the core bridge's Automatic Reference Counting (ARC) behavior with `clang`'s documentation, specifically for 'init' family methods. These methods now correctly steal a reference to `self` and return a new one, which might affect existing custom `__init__` implementations or complex initialization patterns that rely on previous PyObjC reference counting behavior.fixReview any custom `__init__` or initializer methods that interact directly with Objective-C objects (e.g., via `alloc`) to ensure they adhere to standard ARC memory management rules for initializer methods.
affects: pyobjc-framework-screensaver 11.1+
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredThis package is a framework binding and requires the core PyObjC bridge.
pythonrequiredRequires Python 3.10 or newer.