PyObjC Framework VideoSubscriberAccount

12.1 · active · verified Tue Apr 14

pyobjc-framework-videosubscriberaccount provides Python wrappers for Apple's VideoSubscriberAccount framework on macOS. It enables Python applications to interact with TV provider authentication services and manage user subscriptions. The current version is 12.1 and it maintains an active release cadence, frequently aligning with macOS SDK updates and Python version support.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the VideoSubscriberAccount framework and access its primary class, `VSAccountManager`. Due to the nature of this framework (TV provider authentication, requiring user interaction and specific application entitlements), a fully functional example within a simple Python script is not feasible. This code shows how to instantiate the `sharedAccountManager` singleton, which is the entry point for most interactions.

import VideoSubscriberAccount
from Foundation import NSObject # NSObject is fundamental to Objective-C, often needed for PyObjC examples

# The VideoSubscriberAccount framework primarily interacts with TV provider authentication
# and subscription management, typically within a full macOS application context
# and requires specific entitlements. This example demonstrates basic class access.

# Get the shared account manager instance
manager = VideoSubscriberAccount.VSAccountManager.sharedAccountManager()

print(f"VSAccountManager instance: {manager}")

# Attempting to fetch a property (e.g., current account) would typically
# require an active application, user interaction, and entitlements.
# For example, to get the primary account, you would usually call
# manager.enqueueAccountMetadataRequest:completionHandler:
# But this is often asynchronous and requires more setup than a quickstart.

# A simple synchronous property if available (conceptual example, may not directly map without setup)
# if manager.isKeyLoaded(): # Not a real method for VSAccountManager, just illustrative
#     print("Account manager key is loaded.")
# else:
#     print("Account manager key not yet loaded or not applicable in this context.")

# The framework is used to present authentication requests to the user.
# E.g., presenting a sign-in view controller via VSAccountManager.presentViewController:.
# This requires a running Cocoa app and is beyond a simple script quickstart.

view raw JSON →