Registry / pyobjc-framework-coreservices

pyobjc-framework-coreservices

JSON →
library12.2.2pypypiunverified

pyobjc-framework-coreservices provides Python wrappers for Apple's CoreServices framework on macOS. It is part of the PyObjC project, a bidirectional bridge enabling Python scripts to interact with Objective-C libraries, including macOS Cocoa frameworks. The current version is 12.1 and it maintains an active, sustainable release cadence, typically aligning with macOS SDK updates and Python version support.

pip install pyobjc-framework-coreservices
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-C
P
pyobjc-framework-coreservices
pythonv12.2.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.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CoreServices
import CoreServices
CoreServices is an umbrella framework; its sub-frameworks' symbols (e.g., LaunchServices, DictionaryServices) are typically accessed directly through the imported 'CoreServices' module.
Foundation
from Foundation import NSURL
Foundation is commonly used with PyObjC frameworks for basic object types like URLs, strings, and collections.

This quickstart demonstrates successfully importing the CoreServices module and accessing a symbolic constant from its LaunchServices sub-framework. It also includes a basic Foundation.NSURL object creation, a common pattern when working with macOS frameworks.

import CoreServices import Foundation print(f"PyObjC CoreServices version: {CoreServices.__version__}") # CoreServices is an umbrella framework. Its functionality is accessed via # symbols from its sub-frameworks, such as LaunchServices. try: # Access a constant from LaunchServices, exposed via CoreServices recent_items_list = CoreServices.kLSSharedFileListRecentDocumentItems print(f"Successfully accessed kLSSharedFileListRecentDocumentItems: {recent_items_list}") except AttributeError: print("CoreServices module loaded, but kLSSharedFileListRecentDocumentItems not found or accessible. " "This might indicate a version or SDK mismatch.") except Exception as e: print(f"An unexpected error occurred: {e}") # Example of creating a basic Foundation object, often used with CoreServices operations file_url = Foundation.NSURL.fileURLWithPath_isDirectory_("/Applications/Safari.app", True) print(f"Created Foundation.NSURL object: {file_url}") print("Quickstart complete.")
Debug
Known issues
breakingPyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped Python 3.8.
fix
Ensure your Python environment is compatible with the PyObjC version you are installing. For PyObjC 12.x, Python >=3.10 is required. Always check `requires_python` on PyPI or the PyObjC changelog for specific version requirements.
affects: 11.0, 12.0+
breakingPyObjC 11.1 changed how initializer methods (methods in the `init` family) are modeled, now correctly reflecting that they 'steal' a reference to `self` and return a new one, as per clang's ARC documentation.
fix
Review code that interacts with object initialization, especially custom subclasses or factory methods, to ensure correct reference handling. Explicit memory management is rarely needed in Python, but understanding the underlying Objective-C semantics is crucial for correct behavior.
affects: 11.1+
gotchaSubclassing certain Cocoa string classes (e.g., `NSString` or `NSMutableString`) in Python can lead to crashes due to special handling within PyObjC.
fix
Avoid subclassing `NSString` or `NSMutableString` directly in Python. If custom string-like behavior is needed, consider wrapping `NSString` instances or subclassing Python's `str` and converting when interacting with Objective-C APIs.
affects: All versions
deprecatedThe `AVFAudio` package was moved from being merged into `AVFoundation` to being a separate top-level package in PyObjC 12.0.
fix
Update imports for `AVFAudio` functionality to `import AVFAudio` instead of accessing it through `AVFoundation`.
affects: 12.0+
deprecatedSeveral functions within the CoreServices framework, such as `LSInit` and `LSTerm`, are no longer available as they were removed in the macOS 10.7 SDK. The `IMServicePlugIn` framework bindings were also removed in PyObjC 10.0 due to deprecation and removal in macOS 14.
fix
Avoid using deprecated CoreServices functions and frameworks. Refer to Apple's latest documentation for modern replacements and best practices.
affects: 10.0+
Upgrade
Version history
12.2.2latest on PyPI · released Aug 11, 2026
Audit
Dependencies
pyobjc-corerequiredThe core bridge between Python and Objective-C, required for all PyObjC framework wrappers.
Agent activity
5 hits · last 30 days
node
4
Resources
pyobjc-framework-coreservices — pip install pyobjc-framework-coreservices · libregistry