Registry / auth-security / pyobjc-framework-accounts

pyobjc-framework-accounts

JSON →
library12.2pypypiunverified

pyobjc-framework-accounts provides Python bindings for Apple's Accounts framework on macOS. It allows Python applications to access and manage user accounts stored in System Preferences, such as social media, mail, and other internet accounts. The library is part of the larger PyObjC project, which acts as a bridge between Python and Objective-C, and is regularly updated to align with the latest macOS SDKs. The current version is 12.1.

pip install pyobjc-framework-accounts
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-A
P
pyobjc-framework-accounts
auth-securitypythonv12.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.

Accounts
import Accounts
Framework bindings are typically imported as a package with the same name as the macOS framework.

This quickstart demonstrates how to import the `Accounts` framework and initialize the core `ACAccountStore` object, which is the entry point for interacting with user accounts. It also shows how to retrieve a specific account type. Note that actual access to user accounts and handling asynchronous operations (like requesting access) typically requires a more complete PyObjC/Cocoa application setup with a running event loop, and will often involve user prompts for permission.

import Accounts import objc # Initialize the ACAccountStore, the primary entry point for the Accounts framework. # Note: Actual account access (e.g., requesting permissions, fetching accounts) # often requires a running NSApplication event loop and user interaction on macOS. # This example demonstrates basic object creation and type identification. account_store = Accounts.ACAccountStore.alloc().init() print(f"Initialized ACAccountStore object: {account_store}") # Get an account type identifier, e.g., for Twitter twitter_type_identifier = Accounts.ACAccountTypeIdentifierTwitter print(f"Twitter Account Type Identifier: {twitter_type_identifier}") # Retrieve the ACAccountType object for Twitter twitter_account_type = account_store.accountTypeWithIdentifier_(twitter_type_identifier) if twitter_account_type: print(f"Retrieved ACAccountType for Twitter: {twitter_account_type.identifier()}") else: print(f"Could not retrieve ACAccountType for identifier: {twitter_type_identifier}") # To request access or fetch accounts, you would typically use a completion handler # and potentially an active NSApplication runloop in a full Cocoa application. # For example (illustrative, not fully runnable without more setup): # import Foundation # account_store.requestAccessToAccountsWithType_options_completion_( # twitter_account_type, # None, # A Python dict for options, or None # lambda granted, error: Foundation.NSLog(f"Access granted: {granted}, Error: {error}") # )
Debug
Known issues
breakingPyObjC versions frequently drop support for older Python versions to align with active Python releases and macOS SDKs. For example, PyObjC 12.0 dropped support for Python 3.9, and 11.0 dropped Python 3.8. Ensure your Python version is compatible with the PyObjC version you are using.
fix
Upgrade your Python environment to a version supported by the latest PyObjC, or pin your PyObjC version to one that supports your Python version.
affects: >=11.0
breakingPyObjC 10.3 introduced a change where `__init__` could no longer be used when `__new__` was provided by PyObjC. While 10.3.1 partially restored this for classes with user-implemented `__new__`, code relying on `__new__` provided by PyObjC still cannot use `__init__`.
fix
Review classes that implement `__new__` or rely on PyObjC's default `__new__` to ensure `__init__` usage is compatible with PyObjC 10.3+ semantics.
affects: 10.3 - 10.3.1
breakingPyObjC 11.1 aligned its behavior with `clang`'s Automatic Reference Counting (ARC) documentation for initializer methods. Methods in the 'init' family now correctly steal a reference to `self` and return a new one, which might change memory management expectations for custom Objective-C classes bridged to Python.
fix
Developers working with custom Objective-C classes in Python should be aware of ARC rules for initializers and adjust reference counting expectations if manually managing memory or observing unexpected deallocations.
affects: >=11.1
gotchaStarting with PyObjC 12.1, Key-Value Observing (KVO) usage is automatically disabled for subclasses of `NSProxy` defined in Python to prevent `SystemError`.
fix
If you have Python subclasses of `NSProxy` that previously relied on KVO, you may need to implement manual observation mechanisms or reconsider the class design, as automatic KVO will no longer function.
affects: >=12.1
gotchaIn PyObjC 10.1, the `os.fspath()` function was updated to work with Cocoa URLs (`NSURL`, `CFURLRef`) that refer to local filesystem paths. It will now raise a `TypeError` for other types of URLs, enabling more robust use of Python's filesystem APIs with Cocoa URLs.
fix
Ensure that if you are using `os.fspath()` with Cocoa URLs, they specifically refer to local filesystem paths. Handle `TypeError` for non-local URLs or use appropriate Cocoa methods for URL manipulation.
affects: >=10.1
breakingThe `IMServicePlugIn` framework bindings were removed in PyObjC 10.0 because the underlying macOS framework was deprecated in macOS 10.13 and completely removed in macOS 14.
fix
Applications relying on `IMServicePlugIn` bindings must update their functionality to use alternative macOS APIs or adjust for the framework's deprecation and removal.
affects: >=10.0
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredProvides the core Python to Objective-C bridge functionality, required by all PyObjC framework bindings.
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
pyobjc-framework-accounts — pip install pyobjc-framework-accounts · libregistry