{"library":"pyobjc-framework-dictionaryservices","title":"PyObjC Framework DictionaryServices","description":"pyobjc-framework-dictionaryservices provides Python wrappers for the macOS DictionaryServices framework, enabling Python applications to interact with the system's dictionary and thesaurus. It is part of the larger PyObjC project, which actively maintains bindings for various macOS frameworks, with releases typically tied to new macOS SDKs and Python version support. The current version is 12.1.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-dictionaryservices"],"cli":null},"imports":["from CoreServices import DCSCopyTextDefinition","from CoreServices import CFRange"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Foundation\nimport CoreServices\nimport objc\n\nword = \"recursive\"\n\n# Create a CFStringRef from a Python string\nstring_ref = Foundation.CFString.stringWithString_(word)\n\n# Define a range covering the entire string\nfull_range = CoreServices.CFRange(0, len(word))\n\n# Look up the definition using DCSCopyTextDefinition\ndefinition_ref = CoreServices.DCSCopyTextDefinition(string_ref, full_range)\n\nif definition_ref:\n    # Convert CFStringRef to Python string and print\n    definition = str(definition_ref)\n    print(f\"Definition of '{word}':\\n{definition}\")\n    # Release the CFStringRef returned by DCSCopyTextDefinition (retained by 'Copy')\n    Foundation.CFRelease(definition_ref)\nelse:\n    print(f\"No definition found for '{word}'.\")\n\n# Release the input CFStringRef\nFoundation.CFRelease(string_ref)","lang":"python","description":"This example demonstrates how to use the macOS DictionaryServices framework via PyObjC to look up the definition of a word. It uses `DCSCopyTextDefinition` which is accessed through the `CoreServices` package.","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-dictionaryservices","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-dictionaryservices","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.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-dictionaryservices","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-dictionaryservices","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-dictionaryservices","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-dictionaryservices","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-dictionaryservices","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-dictionaryservices","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-dictionaryservices","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-dictionaryservices","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.7,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}