{"library":"pyobjc-framework-networkextension","title":"PyObjC Framework NetworkExtension","description":"PyObjC Framework NetworkExtension provides Python wrappers for Apple's NetworkExtension framework on macOS. It enables Python applications to interact with system-level networking features, such as VPN configuration and management. Currently at version 12.1, this library is part of the larger PyObjC project, which generally aligns its release cadence with new macOS SDK versions.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-NetworkExtension"],"cli":null},"imports":["import NetworkExtension","from NetworkExtension import NEVPNManager"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import NetworkExtension\nimport objc\nfrom Foundation import NSLog\nimport threading\n\n# Note: Accessing NetworkExtension APIs typically requires specific\n# entitlements in your application's Info.plist and proper code signing.\n# This script may require root privileges or fail without them.\n\ndef completion_handler(managers, error):\n    if error:\n        NSLog('Error loading VPN configurations: %@', error)\n    elif managers:\n        NSLog('Found %d VPN configurations:', len(managers))\n        for manager in managers:\n            NSLog('  - Name: %@, Enabled: %@', manager.localizedDescription(), 'Yes' if manager.enabled() else 'No')\n    else:\n        NSLog('No VPN configurations found.')\n    \n    # Signal that the async operation is complete\n    completion_event.set()\n\nNSLog('Attempting to load VPN configurations...')\n\n# Use a threading.Event to wait for the asynchronous callback in a script\ncompletion_event = threading.Event()\n\nmanager_class = NetworkExtension.NEVPNManager\nmanager = manager_class.sharedManager()\n\n# loadAllFromPreferencesWithCompletionHandler_ is an asynchronous call.\n# The Objective-C block is automatically translated to a Python callable.\nmanager.loadAllFromPreferencesWithCompletionHandler_(completion_handler)\n\n# Wait for the completion handler to be called (max 5 seconds)\ncompletion_event.wait(5.0)\n\nNSLog('Quickstart finished.')\n","lang":"python","description":"This quickstart demonstrates how to list existing VPN configurations using `NEVPNManager`. It retrieves the shared manager instance, asynchronously loads all VPN preferences, and prints the names and enabled status of any found configurations. Note that proper entitlements and code signing are usually required for real-world usage of NetworkExtension APIs.","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-NetworkExtension","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-NetworkExtension","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"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-NetworkExtension","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-NetworkExtension","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-NetworkExtension","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-NetworkExtension","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"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-NetworkExtension","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-NetworkExtension","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.5,"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-NetworkExtension","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-NetworkExtension","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.4,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}