Registry / communication / pyobjc-framework-social

pyobjc-framework-social

JSON →
library12.2pypypiunverified

PyObjC is a bridge between Python and Objective-C, enabling Python developers to write full-featured Cocoa applications and interact with macOS system frameworks. The `pyobjc-framework-social` package provides Python wrappers for Apple's Social.framework, allowing programmatic access to social media services integrated into macOS, such as sharing content. The library is currently at version 12.1 and typically releases updates in alignment with major macOS SDK changes and Python version support.

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

SLComposeViewController
from Social import SLComposeViewController
Classes and constants from macOS frameworks are imported directly from their respective PyObjC wrapper packages (e.g., `Social` for Social.framework).
SLServiceTypeTwitter
from Social import SLServiceTypeTwitter
Framework-defined constants are typically available directly from the wrapper package.
objc
import objc
The core PyObjC bridge module for low-level interactions or utility functions.

This quickstart demonstrates how to import and use basic functionality from the `Social` framework to check the availability of social media services (Twitter and Facebook) on macOS. It highlights the direct access to Objective-C classes and their static methods provided by PyObjC. Note that interacting with the UI for composing a post (e.g., displaying `SLComposeViewController`) would require a running `NSApplication` event loop, which is a more involved setup not covered in this minimal example.

import objc from Social import SLComposeViewController, SLServiceTypeTwitter, SLServiceTypeFacebook def check_social_services(): """ Checks if Twitter and Facebook social services are available on macOS. Note: This example demonstrates basic availability checks without requiring a full NSApplication event loop for UI presentation. """ # Explicitly load the Social framework if not already done by imports. # This is often implicit but good for clarity in specific cases. objc.loadBundle("Social", globals(), bundle_path=objc.pathForFramework("/System/Library/Frameworks/Social.framework")) twitter_available = SLComposeViewController.isAvailableForServiceType_(SLServiceTypeTwitter) facebook_available = SLComposeViewController.isAvailableForServiceType_(SLServiceTypeFacebook) print(f"Twitter service available: {twitter_available}") print(f"Facebook service available: {facebook_available}") if __name__ == "__main__": check_social_services()
Debug
Known issues
breakingPyObjC has periodically dropped support for older Python versions. Version 12.0 dropped support for Python 3.9, and version 11.0 dropped support for Python 3.8. Ensure your Python environment meets the `requires_python` specification (>=3.10 for v12.1).
fix
Upgrade to a supported Python version (3.10 or newer for PyObjC 12.x).
affects: 11.0, 12.0
breakingVersion 11.1 introduced a change in how PyObjC models Automatic Reference Counting (ARC) for Objective-C initializer methods (`init` family). It now correctly reflects that these methods steal a reference to `self` and return a new one, which changed previous behavior where `alloc()` proxies were marked as 'partially initialized'. This may affect custom Objective-C subclasses or complex memory management patterns.
fix
Review custom Objective-C subclasses and manual memory management code to ensure compatibility with clang's ARC rules for initializers, especially if relying on the old 'partially initialized' state.
affects: >=11.1
gotchaWhen subclassing Objective-C classes in Python and providing a custom `__new__` method, using `__init__` had a regression in v10.3. While v10.3.1 restored this functionality for user-defined `__new__` implementations, classes relying on PyObjC's default `__new__` still cannot use `__init__` for initialization.
fix
For custom `__new__` in Python subclasses, ensure you call the superclass's `__new__` and then explicitly call `init` methods on the Objective-C object returned. Avoid using `__init__` if `__new__` is not user-defined, or carefully test its interaction.
affects: 10.3
breakingFramework bindings can be removed if the underlying macOS framework is deprecated and removed by Apple. For instance, PyObjC 10.0 removed bindings for the `IMServicePlugIn` framework, as it was deprecated in macOS 10.13 and fully removed in macOS 14.
fix
Always check PyObjC release notes for removed framework bindings, especially when upgrading to versions that support newer macOS SDKs. Migrate away from deprecated macOS frameworks in your applications.
affects: 10.0
gotchaPyObjC version 12.1 automatically disables Key-Value Observing (KVO) usage for subclasses of `NSProxy` that are defined in Python. This change was implemented to prevent potential `SystemError` issues.
fix
If you have Python-defined subclasses of `NSProxy` and were relying on KVO, be aware that it is now automatically disabled. Consider alternative observation patterns or review your use case.
affects: >=12.1
gotchaBuilding PyObjC, including individual framework wrappers like `pyobjc-framework-social`, from source (e.g., with `--no-binary :all:` or from a Git checkout) requires Apple's Xcode or Command Line Tools to be installed. A compatible macOS SDK (ideally the latest or newer than your current OS version) is necessary; using an older SDK may lead to build errors.
fix
Install Xcode or the Command Line Tools via `xcode-select --install`. For most users, using binary wheels (`pip install ...`) is the recommended and easier approach as it avoids compiler requirements.
affects: All versions (when building from source)
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredCore bridge between Python and Objective-C, required by all PyObjC framework wrappers.
Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
pyobjc-framework-social — pip install pyobjc-framework-social · libregistry