PyObjC Documentation

repository·main·Indexed 18 days ago

https://github.com/ronaldoussoren/pyobjc

A bridge between Python and Objective-C that allows Python developers to access Apple's Cocoa frameworks and system APIs. Includes documentation on the objc module for runtime introspection, dynamic class modification, memory management via autorelease pools, and CoreGraphics context managers such as CGSavedGState, CGTransparencyLayer, and GContextPage.

Tokens
90.8K
Snippets
362
Records
592
Agent score
74%

What's inside PyObjC

  1. What is PyObjC?

    main
    PyObjC provides bidirectional bindings between Python and Objective-C, allowing developers to use most macOS Objective-C frameworks directly within Python scripts. It aims to provide a first-class experience for developing macOS applications and scripts using Apple's high-level system APIs.
  2. Overview of PyObjC functionality

    main

    PyObjC provides the bridge between the Python interpreter and the Objective-C language. It allows you to use Objective-C objects and classes as first-class Python citizens.

    Key capabilities include:

    • Interfacing with Objective-C objects and classes via the objc module.
    • Subclassing existing Objective-C classes within Python.
    • Accessing Cocoa frameworks (such as Foundation and AppKit) through specialized wrapper modules that expose framework classes, functions, and constants.
  3. Use the LaunchServices framework via PyObjC

    main

    The pyobjc-framework-LaunchServices package provides Python wrappers for Apple's LaunchServices framework.

    Because these are direct wrappers, they do not include local documentation. To use this framework effectively, you must refer to the official Apple developer documentation for the LaunchServices framework to understand its classes, methods, and logic. For general guidance on how PyObjC translates Objective-C types and patterns into Python, consult the main PyObjC documentation.

  4. Debug PyObjC crashes with PyObjCTools.Signals

    main

    The PyObjCTools.Signals module provides tools to investigate random crashes in PyObjC programs, which are frequently caused by Objective-C style weak references or incorrectly implemented protocols.

    Warning: This module is not designed for fine-grained control or high robustness. It may cause a crash when a signal is received. For general purpose stack dumping, it is recommended to use Python's built-in faulthandler module instead.

  5. Use the DictionaryServices framework via PyObjC

    main

    The pyobjc-framework-DictionaryServices package provides Python wrappers for Apple's DictionaryServices framework.

    Because these wrappers are direct translations of the Objective-C framework, they do not include local documentation. To use this framework effectively, you must refer to Apple's official documentation for the specific API details and methods. For general guidance on how PyObjC translates Objective-C types and patterns into Python, refer to the main PyObjC documentation.

  6. Use the CFOpenDirectory framework wrappers

    main

    The pyobjc-framework-OpenDirectory package provides Python wrappers for Apple's CFOpenDirectory framework.

    Because these wrappers are direct translations of the Objective-C framework, they do not include local Python documentation. To understand the available classes, methods, and parameters, you must refer to the official Apple developer documentation for CFOpenDirectory.

  7. Use the LatentSemanticMapping framework via PyObjC

    main

    This package provides Python wrappers for Apple's LatentSemanticMapping framework.

    Note: These wrappers do not include local documentation. To understand the specific classes, methods, and logic of the LatentSemanticMapping framework, you must refer to the official Apple developer documentation. For general guidance on how PyObjC translates Objective-C patterns (like delegates, blocks, and memory management) into Python, refer to the main PyObjC documentation.

  8. Use CoreLocation framework wrappers

    main

    This package provides Python wrappers for Apple's CoreLocation framework.

    Note on Documentation: These wrappers do not include built-in documentation. To understand the available classes, methods, and properties, you must refer to:

    1. Apple's official CoreLocation documentation for the underlying framework logic and API surface.
    2. PyObjC's documentation for guidance on translating between Python and (Objective-)C frameworks (e.g., handling types, memory management, and delegates).
  9. Use the CFNetwork framework wrappers

    main

    The pyobjc-framework-CFNetwork package provides Python wrappers for Apple's CFNetwork framework.

    Because these wrappers are direct translations of the underlying C/Objective-C framework, they do not include local documentation. To use this framework effectively, you must refer to Apple's official documentation for the CFNetwork framework to understand the API surface, method signatures, and expected behaviors.

  10. Use the InputMethodKit framework via PyObjC

    main

    The pyobjc-framework-InputMethodKit package provides Python wrappers for Apple's InputMethodKit framework.

    Note that these wrappers do not include local documentation. To use this framework, you must refer to:

    1. Apple's official documentation for the specific API details, classes, and methods of InputMethodKit.
    2. PyObjC's documentation for guidance on translating between Python and (Objective-)C patterns (e.g., handling types, memory management, and method signatures).
  11. Use the ScreenSaver framework via PyObjC

    main

    The pyobjc-framework-ScreenSaver package provides Python wrappers for Apple's ScreenSaver framework.

    Note: This package does not include local documentation. To understand the available classes, methods, and properties, you must refer to the official Apple Developer documentation for the ScreenSaver framework. For general guidance on how PyObjC translates Objective-C types to Python, consult the PyObjC documentation.