Registry / pyobjc-framework-screensaver

pyobjc-framework-screensaver

JSON →
library12.2pypypiunverified

PyObjC Framework ScreenSaver provides Python bindings and wrappers for the macOS ScreenSaver.framework, enabling Python developers to interact with and create macOS screensavers. It is part of the larger PyObjC project, which offers comprehensive bridges to Objective-C frameworks. The current version is 12.1 and its release cadence is tied to updates in the macOS SDK and Python version support by the core PyObjC project.

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

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.
fix
Ensure 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.
fix
If 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.
fix
Review 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.
Agent activity
4 hits · last 30 days
node
4
Resources
pyobjc-framework-screensaver — pip install pyobjc-framework-screensaver · libregistry