PyObjC SharedWithYou Framework

12.1 · active · verified Tue Apr 14

pyobjc-framework-sharedwithyou provides Python wrappers for Apple's SharedWithYou framework on macOS. It is part of the PyObjC project, a bidirectional bridge enabling Python scripts to interact with Objective-C libraries, including macOS Cocoa frameworks. The current version is 12.1 and it maintains an active release cadence, typically aligning with macOS SDK updates and Python version support.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the fundamental interaction pattern with Objective-C frameworks using PyObjC, specifically showing how to import and interact with a basic Foundation object. Classes within the SharedWithYou framework would be imported and instantiated similarly through the `SharedWithYou` module.

import Foundation
import SharedWithYou # Assuming SharedWithYou classes are directly exposed

# This example demonstrates basic PyObjC interaction by creating a Foundation object.
# Interactions with SharedWithYou classes would follow a similar pattern.

# Create an instance of a Foundation object
hello_string = Foundation.NSString.stringWith_('Hello from PyObjC SharedWithYou!')
print(f"Created Objective-C string: {hello_string}")

# You would typically interact with SharedWithYou classes here.
# For example, if there was a 'SWYCollaboration' class:
# try:
#     collaboration = SharedWithYou.SWYCollaboration.alloc().init()
#     print(f"Created SharedWithYou Collaboration object: {collaboration}")
# except AttributeError:
#     print("SWYCollaboration class not found or initialized in this simple example.")

print("PyObjC bridge is active and ready to interact with macOS frameworks.")

view raw JSON →