{"id":5807,"library":"pyobjc-framework-eventkit","title":"PyObjC EventKit Framework","description":"PyObjC provides Pythonic wrappers for macOS Cocoa frameworks, allowing Python applications to interact directly with native macOS APIs. The `pyobjc-framework-eventkit` package offers bindings specifically for Apple's EventKit framework, enabling Python developers to work with calendar events, reminders, and calendars on macOS. The current version is 12.1, and releases are tied closely to macOS SDK updates and Python version support, typically with multiple releases per year.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","cocoa","apple","eventkit","calendar","events","reminders"],"install":[{"cmd":"pip install pyobjc-framework-eventkit","lang":"bash","label":"Install pyobjc-framework-eventkit"}],"dependencies":[{"reason":"Core PyObjC bridge functionality required by all framework bindings.","package":"pyobjc-core"}],"imports":[{"symbol":"EKEventStore","correct":"from EventKit import EKEventStore"},{"symbol":"EKEvent","correct":"from EventKit import EKEvent"},{"symbol":"EKCalendar","correct":"from EventKit import EKCalendar"},{"symbol":"EKEntityTypeEvent","correct":"from EventKit import EKEntityTypeEvent"}],"quickstart":{"code":"import objc\nfrom EventKit import EKEventStore, EKEntityTypeEvent\n\n# Initialize Event Store\nstore = EKEventStore.alloc().init()\n\n# Note: Access to EventKit data requires user permission on macOS.\n# Your application must be signed and have the correct entitlements.\n# The user will be prompted for permission on first access. Once granted,\n# subsequent runs will not prompt again.\n\n# Attempt to fetch calendars for events (EKEntityTypeEvent)\n# In a real application, you would first check authorizationStatusForEntityType_\n# and requestAccessToEntityType_completion_ if needed.\n\nprint(\"Attempting to fetch calendars (requires Calendar access permission)...\")\n\ntry:\n    calendars = store.calendarsForEntityType_(EKEntityTypeEvent)\n    if calendars:\n        print(f\"Found {len(calendars)} calendars:\")\n        for calendar in calendars:\n            print(f\"  - Title: {calendar.title()}, Type: {calendar.type()}\")\n    else:\n        print(\"No calendars found for events.\")\nexcept Exception as e:\n    print(f\"Error fetching calendars: {e}\")\n    print(\"Make sure your application has Calendar access permission in System Settings > Privacy & Security.\")\n\nprint(\"Quickstart complete.\")\n","lang":"python","description":"This quickstart initializes an `EKEventStore` and attempts to list the user's available calendars for events. This operation requires user permission for 'Calendar' access on macOS, which will be prompted the first time your application requests access. Ensure your application is properly sandboxed and entitled if distributing, or grant permissions manually during development."},"warnings":[{"fix":"Upgrade Python to 3.10 or a newer supported version.","message":"PyObjC 12.0 dropped support for Python 3.9. If you are using Python 3.9, you must upgrade your Python version to 3.10 or later to use PyObjC 12.x.","severity":"breaking","affected_versions":"12.0+"},{"fix":"Upgrade Python to 3.9 or a newer supported version.","message":"PyObjC 11.0 dropped support for Python 3.8. Users on Python 3.8 must upgrade their Python version to 3.9 or later (and 3.10+ for PyObjC 12.x).","severity":"breaking","affected_versions":"11.0+"},{"fix":"Thoroughly test existing code that defines custom initializer methods (e.g., `initWithName_`) in Python subclasses after upgrading. Consult PyObjC documentation on memory management.","message":"PyObjC 11.1 aligned its behavior for `init` family methods with clang's Automatic Reference Counting (ARC) documentation. This might change reference counting behavior for custom initializer methods defined in Python subclasses of Objective-C objects, potentially leading to memory management issues if not accounted for.","severity":"breaking","affected_versions":"11.1+"},{"fix":"Ensure your development and deployment environment is macOS. For cross-platform applications, consider platform-agnostic alternatives or abstract your macOS-specific code.","message":"PyObjC is a macOS-specific library. It provides bindings to Apple's Cocoa frameworks and will only run on macOS. It is not compatible with other operating systems like Linux or Windows.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Handle permission requests in your application logic using `EKEventStore.requestAccessToEntityType_completion_()`. For distributed applications, ensure your app's `Info.plist` includes `NSCalendarsUsageDescription` (and `NSRemindersUsageDescription` for reminders) and is correctly sandboxed and signed with the necessary entitlements.","message":"Access to EventKit data (calendars, events, reminders) requires explicit user permission on macOS. Your application must be properly signed and have the correct entitlements (e.g., `com.apple.security.personal-information.calendars`), and the user will be prompted on first access. Without permission, EventKit API calls will fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If your application relied on `IMServicePlugIn` functionality, you will need to update your code to use alternative communication frameworks or APIs if targeting macOS 14 or later. This is only relevant if your application specifically used this older framework.","message":"The `IMServicePlugIn` framework bindings were removed in PyObjC 10.0. This aligns with Apple's deprecation and subsequent removal of the framework in macOS 14.","severity":"breaking","affected_versions":"10.0+"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}