PyObjC: Automatic Assessment Configuration Framework

12.1 · active · verified Tue Apr 14

Wrappers for the `AutomaticAssessmentConfiguration` framework on macOS, enabling Python applications to interact with Apple's API for creating secure assessment sessions. This library is part of the larger PyObjC project, currently at version 12.1, and receives regular updates to align with macOS SDK changes.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the `AutomaticAssessmentConfiguration` framework and check for the availability of its core class, `AEAssessmentSession`. Actual usage of the framework, such as starting and ending assessment sessions, requires specific entitlements from Apple and adherence to a proper macOS application lifecycle.

import AutomaticAssessmentConfiguration
import objc

# The AutomaticAssessmentConfiguration framework is available from macOS 10.15.4.
# The main class is AEAssessmentSession. To use it, your app MUST have the
# 'com.apple.developer.automatic-assessment-configuration' entitlement.

print(f"PyObjC framework version: {AutomaticAssessmentConfiguration.__version__}")

if hasattr(AutomaticAssessmentConfiguration, 'AEAssessmentSession') and AutomaticAssessmentConfiguration.AEAssessmentSession is not objc.nil:
    print("AutomaticAssessmentConfiguration.AEAssessmentSession class is available.")
    # Example (requires entitlement and proper app lifecycle):
    # session = AutomaticAssessmentConfiguration.AEAssessmentSession.alloc().init()
    # # ... configure and begin session ...
    # session.beginAssessmentSessionWithConfiguration_completionHandler_(None, lambda error: print(f'Session begin error: {error}'))
    # # ... perform assessment ...
    # session.endAssessmentSessionWithCompletionHandler_(lambda error: print(f'Session end error: {error}'))
else:
    print("AutomaticAssessmentConfiguration.AEAssessmentSession class is not found or framework not loaded.")

view raw JSON →