Registry / pyobjc-framework-coremotion

pyobjc-framework-coremotion

JSON →
library12.2pypypiunverified

PyObjC is a bridge between Python and Objective-C, enabling Python developers to write macOS applications and scripts using Apple's high-level system APIs. The `pyobjc-framework-coremotion` package provides Python wrappers for the CoreMotion framework on macOS, allowing access to device motion and environment-related data. The library is currently at version 12.1 and typically releases new major versions aligned with macOS SDK updates, usually around October/November, with minor bugfix releases as needed.

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

CoreMotion
import CoreMotion
The CoreMotion framework bindings are accessed directly through the 'CoreMotion' package name.
CMMotionManager
from CoreMotion import CMMotionManager
from CoreMotion.CMMotionManager import CMMotionManager
Classes within the CoreMotion framework are attributes of the imported `CoreMotion` module, not submodules.

This quickstart demonstrates how to import the `CoreMotion` framework and access a common class like `CMMotionManager`. While actual motion data retrieval requires a running macOS application context and user permissions, this code verifies that the framework is correctly imported and its classes are accessible in Python.

import CoreMotion from Foundation import NSObject # Foundation is part of pyobjc-framework-Cocoa, which is usually installed with pyobjc # A simple check to ensure the CoreMotion framework is available and a class is accessible. # Actual use of CMMotionManager to get data would require an active NSApplication/NSRunLoop # and appropriate user permissions on macOS. print(f"CoreMotion module: {CoreMotion.__name__}") if hasattr(CoreMotion, 'CMMotionManager'): print(f"CMMotionManager class found: {CoreMotion.CMMotionManager}") # Example: Attempting to instantiate CMMotionManager (requires an app context on macOS) # manager = CoreMotion.CMMotionManager.alloc().init() # print(f"CMMotionManager instance created: {manager}") else: print("CMMotionManager class not found. Ensure correct macOS version and PyObjC installation.")
Debug
Known issues
breakingPyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped support for Python 3.8. Users on these Python versions must pin to older PyObjC releases (e.g., PyObjC 11.1 for Python 3.9, PyObjC 10.3 for Python 3.8).
fix
Upgrade Python to 3.10 or newer, or pin PyObjC to a compatible earlier version, e.g., `pip install pyobjc-framework-coremotion==11.1` for Python 3.9.
affects: >=11.0, >=12.0
breakingPyObjC 11.1 changed how it handles Automatic Reference Counting (ARC) for Objective-C initializer methods. Methods in the 'init' family now correctly steal a reference to `self` and return a new one, diverging from previous 'partially initialized' object handling.
fix
Review custom Python subclasses of Objective-C objects, especially those overriding 'init' methods, to ensure compatibility with standard ARC behavior. Existing code might need adjustments if it relied on the prior 'partially initialized' state.
affects: >=11.1
gotchaThe behavior around Python's `__init__` and Objective-C's `__new__` for PyObjC classes can be subtle. While PyObjC 10.3 initially broke `__init__` for classes relying on PyObjC's `__new__`, version 10.3.1 restored `__init__` functionality if the class or its superclasses implement their own `__new__` method. Classes relying on the PyObjC-provided `__new__` still cannot use `__init__`.
fix
For Python classes subclassing Objective-C objects, prefer Objective-C style `init*` methods. If overriding `__new__`, ensure it correctly calls `super().__new__` and returns an Objective-C object. If implementing `__init__`, ensure it doesn't conflict with PyObjC's object instantiation lifecycle, especially if not providing a custom `__new__`.
affects: >=10.3
gotchaPyObjC 11.0 introduced experimental support for free-threading (PEP 703) with Python 3.13. While supported, users should be aware that this is an experimental feature and may have stability implications.
fix
Monitor PyObjC release notes for updates on free-threading stability. If encountering issues related to concurrency with Python 3.13+, consider running without free-threading (if possible) or providing feedback to the PyObjC project.
affects: >=11.0
gotchaInstalling PyObjC from source (e.g., if binary wheels are unavailable or a specific SDK is needed) requires the Xcode Command Line Tools to be installed. Using an older macOS SDK than the one PyObjC was built against can lead to build errors.
fix
Ensure Xcode Command Line Tools are installed (`xcode-select --install`). For most users, using binary wheels (`pip install ...`) is the preferred and simpler installation method that avoids compiler requirements.
affects: all
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredThis package provides the fundamental bridge between Python and Objective-C, upon which all PyObjC framework wrappers are built.
Agent activity
4 hits · last 30 days
node
4
Resources
pyobjc-framework-coremotion — pip install pyobjc-framework-coremotion · libregistry