PyObjC Framework: LibXPC

12.1 · active · verified Tue Apr 14

PyObjC-framework-libxpc provides Python bindings for the macOS XPC framework, allowing Python applications to interact with XPC services. It is part of the larger PyObjC project, currently at version 12.1, and follows a release cadence tied to macOS SDK updates and Python version support.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates importing the `libxpc` framework and accessing a couple of its core symbols to confirm the bindings are correctly installed and available. A full functional XPC client or service would require more extensive setup.

import libxpc
import objc

def main():
    print(f"Accessing XPC framework symbols: {libxpc.xpc_main.__name__}")
    print(f"XPC types available: {libxpc.xpc_type_connection.__name__}")
    # Note: A full XPC client/server requires more setup beyond a quickstart.
    # This example only verifies the framework import and symbol access.
    
    # Example of a common PyObjC utility function, not directly libxpc but relevant.
    class MyDelegate(objc.lookUpClass('NSObject')):
        pass
    print(f"Successfully looked up NSObject: {MyDelegate.__name__}")

if __name__ == '__main__':
    main()

view raw JSON →