Registry / pyobjc-core

pyobjc-core

JSON →
library12.2.2pypypiunverified

PyObjC Core is the essential bridge between Python and Objective-C, enabling Python applications to interact with macOS Cocoa frameworks. Version 12.1 is current, and releases typically align with new macOS SDKs and Python versions, with major versions appearing roughly annually and patches more frequently.

pip install pyobjc-core
INSTALL
IMPORT
SIG · PYOBJC-CORE
P
pyobjc-core
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.910 runs
build_error
glibc
py 3.103.910 runs
build_error
Code
Verified usage

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

objc
import objc
The 'objc' module contains the core bridging functionality, including functions to look up Objective-C classes and fundamental constants.
lookUpClass
from objc import lookUpClass
from pyobjc_core import lookUpClass
Core PyObjC functions and classes are exposed directly under the 'objc' module, not 'pyobjc_core'.
python_class
from objc import python_class
Decorator to mark a Python class as an Objective-C class.

This quickstart demonstrates fundamental PyObjC interoperability, including converting Python types to Objective-C types, interacting with core Cocoa framework classes (like NSString and NSDate from Foundation), and defining Objective-C classes in Python. For this example to run, `pip install pyobjc` (which includes `pyobjc-core` and common frameworks like Foundation) is recommended.

import objc from Foundation import NSString, NSDate, NSObject # 1. Basic interoperability: Python string to Objective-C NSString python_string = "Hello from PyObjC!" objc_string = NSString.stringWithString_(python_string) print(f"Python string: '{python_string}' (Type: {type(python_string)})\n") print(f"Objective-C NSString: '{objc_string}' (Type: {type(objc_string)})\n") # 2. Get current date as NSDate current_nsdate = NSDate.date() print(f"Current NSDate: {current_nsdate} (Type: {type(current_nsdate)})\n") # 3. Define a Python class that inherits from an Objective-C class @objc.python_class class MyPythonObject(NSObject): def init(self): self = objc.super(MyPythonObject, self).init() if self is None: return None self.message = "I am a Python-backed Objective-C object!" return self # Expose a method callable from Objective-C (and Python) @objc.selector('myCustomMethod') def myCustomMethod(self): return self.message # Create an instance and call the method # Note: alloc().init() is the standard Objective-C way to create objects. python_objc_instance = MyPythonObject.alloc().init() print(f"Message from Python-backed ObjC instance: {python_objc_instance.myCustomMethod()}\n")
Debug
Known issues
gotchaPyObjC is a macOS-specific bridge; it relies on macOS's Objective-C runtime and Cocoa frameworks. It will not work on Windows or Linux.
fix
Develop on macOS for applications leveraging PyObjC.
affects: All versions
breakingPyObjC frequently drops support for older Python versions (e.g., Python 3.9 dropped in v12.0, Python 3.8 in v11.0) to align with macOS SDKs and Python's own end-of-life cycles. Always check the 'requires_python' metadata for compatibility.
fix
Ensure your Python environment meets the minimum version requirements for the PyObjC release you are using.
affects: v11.0, v12.0, and future major versions
breakingPyObjC 11.1 introduced significant changes to how initializer methods (`init` family) handle reference counting to align with `clang`'s Automatic Reference Counting (ARC) documentation. This can change memory management behavior and potentially cause leaks or crashes in existing code that made assumptions about object lifecycle during initialization.
fix
Review code involving Objective-C initializer methods to ensure correct reference management in light of ARC semantics. Consult the PyObjC 11.1 release notes for details.
affects: v11.1 and later
gotchaWhile PyObjC 11 introduced experimental support for Python's PEP 703 (free-threading) feature in Python 3.13, it is still experimental. Use with caution, as it may not be stable or fully optimized for production environments.
fix
Avoid using free-threading with PyObjC in critical applications until it is officially declared stable. Test thoroughly if experimental features are enabled.
affects: v11.0 and later (when used with Python 3.13+)
gotcha`pyobjc-core` provides the fundamental bridge, but for most practical application development, you will also need specific framework bindings (e.g., `pyobjc-framework-Foundation`, `pyobjc-framework-AppKit`). The `pyobjc` meta-package installs `pyobjc-core` and many common frameworks and is generally recommended for ease of use.
fix
For full functionality, install `pyobjc` using `pip install pyobjc` rather than `pyobjc-core` alone.
affects: All versions
Upgrade
Version history
12.2.2latest on PyPI · released Aug 11, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
pyobjc-core — pip install pyobjc-core · libregistry