Registry / pyobjc-framework-screentime

pyobjc-framework-screentime

JSON →
library12.2pypypiunverified

PyObjC is a bridge between Python and Objective-C, enabling Python scripts to use and extend existing Objective-C class libraries, primarily Apple's Cocoa frameworks. `pyobjc-framework-screentime` provides Python wrappers for the macOS ScreenTime framework, allowing access to its APIs. The library is currently at version 12.1 and maintains an active release cadence, typically aligning with macOS and Python version updates.

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

ScreenTime
import ScreenTime
Bindings for the ScreenTime framework are accessed through the 'ScreenTime' package.

This quickstart demonstrates basic object instantiation and method calling using `Foundation.NSDate`, a common pattern applicable across PyObjC frameworks. Specific ScreenTime API usage will follow Apple's Objective-C documentation.

import Foundation import ScreenTime # Import the specific framework def demonstrate_pyobjc_basics(): """Demonstrates basic PyObjC object creation and method calls.""" # Example using a common Foundation class now = Foundation.NSDate.date() # Pythonic instantiation (available since PyObjC 10.3) print(f"Current NSDate object: {now}") print(f"Description of NSDate: {now.description()}") # To use ScreenTime, you would typically interact with its specific classes and functions. # For instance, if ScreenTime had a class like 'STConfiguration' (hypothetical example): # try: # config_manager = ScreenTime.STConfiguration.alloc().init() # print(f"ScreenTime configuration manager: {config_manager}") # except AttributeError: # print("Hypothetical STConfiguration class not found or API not accessible.") print("Note: Actual ScreenTime API usage requires specific macOS versions, permissions, and understanding of Apple's documentation.") if __name__ == "__main__": demonstrate_pyobjc_basics()
Debug
Known issues
breakingPyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped Python 3.9, and PyObjC 11.0 dropped Python 3.8. Always check the `requires_python` metadata or release notes to ensure compatibility with your Python environment.
fix
Ensure your Python environment meets the `requires_python` specification (>=3.10 for PyObjC 12.1) before upgrading PyObjC.
affects: >=11.0
breakingPyObjC 11.1 aligned its core bridge with `clang`'s Automatic Reference Counting (ARC) documentation for initializer methods. Methods in the 'init' family now correctly steal a reference to `self` and return a new reference. This changed behavior for `[NSObject alloc]` proxies and can affect custom `init` implementations, potentially leading to crashes if old patterns are used.
fix
Review custom `init` implementations in Python subclasses of Objective-C objects. PyObjC 10.3 introduced a Pythonic `Class(...)` instantiation pattern that is generally safer and recommended.
affects: >=11.1
gotchaVersion 10.3 initially broke `__init__` usage for Python subclasses of Objective-C classes, particularly when a user implemented `__new__` or when relying on PyObjC's `__new__` behavior. This was partially reverted in 10.3.1 to reintroduce `__init__` support when a user implements `__new__`.
fix
When subclassing Objective-C classes, implement Objective-C style `init` methods (e.g., `initWithFoo_:`). If overriding `__new__` in a Python subclass, be aware of the interaction with `__init__` and refer to PyObjC documentation on object instantiation. The Pythonic `Class(...)` instantiation is often a safer alternative.
affects: 10.3 - 10.3.1
gotchaPyObjC 11.0 introduced experimental support for free-threading (PEP 703) with Python 3.13+. While PyObjC protects its own implementation, Apple's frameworks are not necessarily thread-safe (e.g., `NSMutableArray` for concurrent updates, non-atomic properties, GUI classes on non-main threads).
fix
Exercise caution when using PyObjC in a free-threaded Python environment (Python 3.13+). Always consult Apple's documentation for the specific framework and classes you are using to understand their thread-safety guarantees.
affects: >=11.0 (with Python 3.13+)
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredThis package provides bindings for a specific macOS framework and depends on the core PyObjC bridge.
PythonrequiredRequires Python 3.10 or newer.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
pyobjc-framework-screentime — pip install pyobjc-framework-screentime · libregistry