Registry / serialization / pyobjc-framework-externalaccessory

pyobjc-framework-externalaccessory

JSON →
library12.2pypypiunverified

PyObjC is a bridge between Python and the Objective-C runtime, allowing Python scripts to interact with macOS frameworks. The `pyobjc-framework-externalaccessory` package provides Python wrappers for the `ExternalAccessory` framework on macOS, enabling interaction with MFi (Made for iOS) accessories. The current version is 12.1, with releases tightly coupled to macOS SDK updates and Python version support cycles.

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

ExternalAccessory
import ExternalAccessory
Framework symbols are typically imported directly under their framework name.

This quickstart demonstrates how to access the shared `EAAccessoryManager` and list currently connected MFi accessories. While this code runs, full interaction with `ExternalAccessory` (e.g., establishing communication sessions, receiving notifications) often requires an active Cocoa event loop and proper application lifecycle management, which is typically handled by `PyObjCTools.AppHelper` in more complex PyObjC applications.

import ExternalAccessory import objc def list_accessories(): manager = ExternalAccessory.EAAccessoryManager.sharedAccessoryManager() accessories = manager.connectedAccessories() if accessories: print(f"Found {len(accessories)} connected accessories:") for acc in accessories: print(f" - Name: {acc.name()}") print(f" Model Number: {acc.modelNumber()}") print(f" Manufacturer: {acc.manufacturer()}") print(f" Serial Number: {acc.serialNumber()}") print(f" Firmware Revision: {acc.firmwareRevision()}") print(f" Hardware Revision: {acc.hardwareRevision()}") print(f" Protocol Strings: {acc.protocolStrings()}") else: print("No MFi accessories connected.") # Note: EAAccessoryManager typically requires an active runloop or # an application context to correctly detect accessories and receive notifications. # For simple scripting, you might need to run a console event loop. # import PyObjCTools.AppHelper # PyObjCTools.AppHelper.runConsoleEventLoop(installInterrupt=True, mode=objc.NSDefaultRunLoopMode, untilIdle=True) if __name__ == '__main__': # This part runs the list_accessories function immediately. # In a full Cocoa app, this would be part of a delegate or controller. # For a simple script, it will just check at startup. list_accessories()
Debug
Known issues
breakingPyObjC aggressively drops support for older Python versions. Version 12.0 dropped Python 3.9, and version 11.0 dropped Python 3.8. Ensure your Python environment meets the `requires_python` specification (currently `>=3.10` for v12.1).
fix
Upgrade your Python version to 3.10 or newer, or downgrade PyObjC to a compatible version if sticking with an older Python.
affects: >=11.0
breakingThe core bridge's Automatic Reference Counting (ARC) behavior for initializer methods (those in the 'init' family) was updated in `v11.1` to align with `clang`'s documentation. This means PyObjC now correctly models that `init` methods steal a reference to `self` and return a new reference, potentially affecting custom `init` methods in Python subclasses.
fix
Review custom Python subclasses that override Objective-C initializer methods to ensure correct reference handling, especially when dealing with manually managed references or complex initialization patterns. Consult PyObjC's documentation on memory management.
affects: >=11.1
gotchaPyObjC is a macOS-specific library. It binds directly to Objective-C frameworks available only on Apple's macOS operating system. Attempts to install or run PyObjC code on Linux, Windows, or other platforms will fail with import errors or linker issues.
fix
Ensure your development and deployment environment is macOS. Use conditional imports or platform checks (`sys.platform == 'darwin'`) if your application needs to support multiple operating systems.
affects: all
gotchaBehavior around `__init__` and `__new__` methods in Python subclasses of Objective-C objects changed in `v10.3` and was partially reverted in `v10.3.1`. While `__init__` can now be used when a user implements `__new__`, code relying on the PyObjC-provided `__new__` still cannot use `__init__` for custom initialization logic.
fix
If implementing custom `__new__` in Python subclasses of ObjC objects, ensure `__init__` is correctly called and interacts with the PyObjC bridge as expected. For classes using PyObjC's default `__new__`, initialization logic must reside in other designated setup methods.
affects: >=10.3
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredProvides the core bridge between Python and Objective-C, essential for all PyObjC framework bindings.
Agent activity
2 hits · last 30 days
node
2
Resources
pyobjc-framework-externalaccessory — pip install pyobjc-framework-externalaccessory · libregistry