Registry / serialization / pyobjc-framework-uniformtypeidentifiers

pyobjc-framework-uniformtypeidentifiers

JSON →
library12.2.2pypypiunverified

PyObjC is a comprehensive bridge that enables Python developers to interact with Objective-C frameworks on macOS. The `pyobjc-framework-uniformtypeidentifiers` package provides Python wrappers for Apple's UniformTypeIdentifiers framework, which allows applications to work with system-declared and custom Uniform Type Identifiers (UTIs) to describe file types, data formats, and other resources. The library is currently at version 12.1 and maintains an active release cadence, often aligning with macOS and Python version updates.

pip install pyobjc-framework-uniformtypeidentifiers
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-U
P
pyobjc-framework-uniformtypeidentifiers
serializationpythonv12.2.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

UniformTypeIdentifiers
import UniformTypeIdentifiers
from UniformTypeIdentifiers import UTType
The `UniformTypeIdentifiers` framework is imported as a module. Classes like `UTType` are attributes of this module, e.g., `UniformTypeIdentifiers.UTType`.

This example demonstrates how to import the `UniformTypeIdentifiers` framework, access system-declared UTIs, check type conformance, and create a UTI from a filename extension. Note that `Foundation` is often imported alongside PyObjC frameworks for basic Cocoa types like `NSURL`.

import UniformTypeIdentifiers from Foundation import NSURL # Foundation is often implicitly needed or useful # Get a system-declared UTI for an image image_type = UniformTypeIdentifiers.UTType.image print(f"Image UTI Identifier: {image_type.identifier}") print(f"Image UTI Preferred filename extension: {image_type.preferredFilenameExtension}") # Check conformance text_type = UniformTypeIdentifiers.UTType.text is_text_conforming_to_data = text_type.conformsToType_(UniformTypeIdentifiers.UTType.data) print(f"Does text UTI conform to data UTI? {is_text_conforming_to_data}") # Get a UTI from a filename extension pdf_type = UniformTypeIdentifiers.UTType.typeWithFilenameExtension_("pdf") if pdf_type: print(f"PDF UTI Identifier: {pdf_type.identifier}")
Debug
Known issues
breakingPyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped Python 3.9 support, and PyObjC 11.0 dropped Python 3.8 support. Version 12.1 corrected packaging metadata that incorrectly showed support for Python 3.9, which could lead to installation failures on that version.
fix
Ensure your Python environment meets the `requires_python` specification (>=3.10 for PyObjC 12.1) before upgrading PyObjC. Always check the PyObjC release notes or PyPI metadata for the target version.
affects: >=11.0
breakingPyObjC 11.1 aligned its core bridge with `clang`'s Automatic Reference Counting (ARC) documentation for initializer methods. Methods in the 'init' family now correctly steal a reference to `self` and return a new reference. This changed behavior for `[NSObject alloc]` proxies and can affect custom `init` implementations, potentially leading to crashes if old patterns are used.
fix
Review custom `init` implementations in Python subclasses of Objective-C objects. PyObjC 10.3 introduced a Pythonic `Class(...)` instantiation pattern that is generally safer.
affects: >=11.1
gotchaVersion 10.3 initially broke `__init__` usage for Python subclasses of Objective-C classes, particularly when a user implemented `__new__` or when relying on PyObjC's `__new__` behavior. This was partially reverted in 10.3.1 to reintroduce `__init__` support when a user implements `__new__`.
fix
When subclassing Objective-C classes, implement Objective-C style `init` methods (e.g., `initWithFoo_:`). If overriding `__new__` in a Python subclass, ensure `__init__` is handled correctly, potentially using the pattern where `__init__` is only called if `__new__` returns an instance of the class itself. Update to 10.3.1 or later to mitigate this specific issue.
affects: 10.3.0
gotcha`NSString` and `NSMutableString` are marked as 'final' in PyObjC versions 11.1 and later. Attempting to subclass these in Python will result in crashes due to special handling within PyObjC.
fix
Do not subclass `NSString` or `NSMutableString` in Python. If custom string behavior is needed, wrap an existing `NSString` or use Python's built-in string types.
affects: >=11.1
gotchaInstalling PyObjC (especially from source or if binary wheels aren't suitable) requires Xcode or the Command Line Tools to be installed on macOS, including a compatible SDK for the target macOS version.
fix
Ensure Xcode or the Command Line Tools are installed via `xcode-select --install` before attempting installation, particularly if encountering compilation errors. Using an older SDK than the target macOS version can lead to build errors.
affects: All versions
gotchaPyObjC is a macOS-specific library and does not function on other platforms like iOS, Linux, or Windows.
fix
Only use PyObjC and its framework wrappers in macOS environments. For cross-platform development, consider alternative libraries or platform-specific conditional logic.
affects: All versions
Upgrade
Version history
12.2.2latest on PyPI · released Aug 11, 2026
Audit
Dependencies
pyobjc-corerequiredThis package is a wrapper for a specific macOS framework and requires the core PyObjC bridge for Objective-C interoperability.
Agent activity
9 hits · last 30 days
node
6
OpenAI (training)
2
Resources
pyobjc-framework-uniformtypeidentifiers — pip install pyobjc-framework-uniformtypeidentifiers · libregistry