Registry / pyobjc-framework-carbon

pyobjc-framework-carbon

JSON →
library12.2pypypiunverified

PyObjC-framework-carbon provides Python bindings for the Carbon framework on macOS. Carbon is an older API set largely deprecated by Apple in favor of Cocoa. This library is part of the larger PyObjC project, which offers comprehensive Objective-C-Python bridging and wrappers for numerous macOS frameworks. The current version is 12.1, and PyObjC typically releases new versions in sync with major macOS SDK updates and Python version support changes.

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

GetCurrentEventLoop
from Carbon.Events import GetCurrentEventLoop

This quickstart attempts to retrieve a reference to the current Carbon Event Loop using a direct Carbon C API call wrapped by PyObjC. It includes error handling to acknowledge that Carbon APIs are deprecated on modern macOS and might not always succeed.

import objc from Carbon.Events import GetCurrentEventLoop def main(): # Attempt to get the current Carbon event loop. # Note: Carbon APIs are largely deprecated on macOS and might not behave as expected # or even be available in newer OS versions/SDKs. try: event_loop = GetCurrentEventLoop() print(f"Successfully retrieved Carbon Event Loop reference: {event_loop}") print(f"Type: {type(event_loop)}") except objc.error as e: print(f"Could not retrieve Carbon Event Loop. Error: {e}") print("This is expected behavior on modern macOS as Carbon APIs are deprecated.") except Exception as e: print(f"An unexpected error occurred: {e}") if __name__ == "__main__": main()
Debug
Known issues
breakingThe Carbon framework, which pyobjc-framework-carbon wraps, is largely deprecated and removed by Apple from macOS. Many APIs may not function as expected or be available on modern macOS versions/SDKs. Relying on Carbon APIs for new development is strongly discouraged.
fix
Migrate your application logic to use Cocoa (AppKit/Foundation) frameworks instead of Carbon. Consult Apple's documentation for equivalent Cocoa APIs.
affects: All versions of `pyobjc-framework-carbon` when used on modern macOS.
breakingPyObjC 12.0 (and by extension, pyobjc-framework-carbon 12.0 and newer) dropped support for Python 3.9. Projects must use Python 3.10 or later.
fix
Upgrade your Python environment to version 3.10 or newer. PyObjC generally follows Python's end-of-life cycle.
affects: pyobjc-core >= 12.0
gotchaPyObjC 11.1 aligned its Automatic Reference Counting (ARC) behavior for initializer methods with `clang`'s documentation. Methods in the 'init' family now correctly 'steal' a reference to `self` and return a new reference. This might subtly change memory management behavior for custom Objective-C subclasses implemented in Python.
fix
Review custom `objc` class initializers and `alloc`/`init` patterns for potential memory management changes when upgrading from `pyobjc-core < 11.1`. Ensure references are managed as expected under the new ARC rules.
affects: pyobjc-core >= 11.1
gotchaBehavior related to `__init__` and `__new__` methods in custom `objc` classes changed in PyObjC 10.3 and was partially reverted in 10.3.1. Specifically, 10.3 prevented calling `__init__` when PyObjC's `__new__` was used, which broke some projects. While 10.3.1 reintroduced `__init__` support when `__new__` is user-implemented, complex interactions can still arise.
fix
Thoroughly test custom `objc` class implementations, especially those overriding both `__init__` and `__new__`, when upgrading PyObjC. Consult the 10.3.x release notes for precise behavior changes.
affects: pyobjc-core 10.3, potentially specific edge cases in 10.3.1
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredProvides the core Objective-C bridge for all PyObjC framework bindings.
Agent activity
4 hits · last 30 days
node
4
Resources
pyobjc-framework-carbon — pip install pyobjc-framework-carbon · libregistry