{"library":"pyobjc-framework-osakit","title":"PyObjC OSAKit Framework Wrappers","description":"PyObjC is a bridge between Python and the Objective-C runtime, enabling Python scripts to interact with Apple's Cocoa frameworks. This specific package, `pyobjc-framework-osakit`, provides Python bindings for the OSAKit framework on macOS, allowing for the creation, compilation, and execution of AppleScripts and other scripting components. The current version is 12.1. Releases are frequent, often correlating with new macOS SDKs and Python version support changes.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-osakit"],"cli":null},"imports":["import OSAKit","import Foundation"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import OSAKit\nimport Foundation\nimport os\n\n# Source for a simple AppleScript\nscript_source = \"\"\"\ndisplay dialog \"Hello from PyObjC OSAKit!\" with title \"PyObjC\"\nreturn \"AppleScript executed successfully.\"\n\"\"\"\n\ntry:\n    # Create an OSAScript instance\n    script = OSAKit.OSAScript.alloc().initWithSource_(script_source)\n\n    # Prepare an error dictionary (Objective-C style error handling)\n    error = Foundation.NSDictionary.dictionary()\n\n    # Compile the script\n    compiled = script.compileAndReturnError_(error)\n\n    if not compiled:\n        print(f\"Error compiling script: {error}\")\n    else:\n        print(\"Script compiled successfully.\")\n        # Execute the script\n        result_desc, error_exec = script.executeAndReturnError_(error)\n        if error_exec:\n            print(f\"Error executing script: {error_exec}\")\n        else:\n            # OSADisplayResult is often an NSAppleEventDescriptor, use stringValue() to get Python string\n            print(f\"Script output: {result_desc.stringValue()}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to use `pyobjc-framework-osakit` to programmatically compile and execute a simple AppleScript. It initializes an `OSAScript` object with source code, attempts to compile it, and if successful, executes it. Error handling follows the common PyObjC pattern using `NSDictionary` to capture Objective-C errors.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"12.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.7,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyobjc-framework-osakit","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.8,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}