Registry / winrt-windows-foundation

winrt-windows-foundation

JSON →
library3.2.1pypypiunverified

winrt-windows-foundation is a Python package that provides a projection of the core Windows Runtime (WinRT) Foundation APIs, enabling Python developers to interact with fundamental Windows features and UWP application components. As of version 3.2.1, it offers enhanced asyncio integration, support for the Python buffer protocol, and streamlined API access. Releases are frequent, often coinciding with updates to the Windows SDK and Windows App SDK.

pip install winrt-windows-foundation
INSTALL
IMPORT
SIG · WINRT-WINDOWS-FOUN
W
winrt-windows-foundation
pythonv3.2.1
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.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

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

Uri
from winrt.windows.foundation import Uri
IAsyncOperation
from winrt.windows.foundation import IAsyncOperation
PropertyValue
from winrt.windows.foundation import PropertyValue
box_int32
from winrt.system import box_int32
from winrt.windows.foundation.interop import box
The `box` and `unbox` functions were moved from `winrt.windows.foundation.interop` to `winrt.system` in v3.0.0, and split into type-specific functions like `box_int32`, `box_string`, etc.

This quickstart demonstrates how to create and interact with a basic WinRT Uri object from the Windows.Foundation namespace, showcasing property access and object comparison.

from winrt.windows.foundation import Uri def main(): # Create a WinRT Uri object url = Uri("https://www.microsoft.com/python") print(f"Original URI: {url.AbsoluteUri}") print(f"Scheme Name: {url.SchemeName}") print(f"Domain: {url.Domain}") print(f"Path: {url.Path}") # Demonstrate a simple comparison another_url = Uri("https://www.microsoft.com/python") if url == another_url: print("URIs are equal.") if __name__ == "__main__": main()
Debug
Known issues
breakingVersion 3.0.0 introduced significant breaking changes, including major changes to module structure, `winrt.system.Object` behavior (e.g., for equality), and the relocation/refactoring of `box`/`unbox` functions. Consult the migration guide for details.
fix
Review the 'scripts/2to3/README.md' in the pywinrt GitHub repository for migration steps. Update import paths and code relying on `Object` comparisons or `box/unbox` functions.
affects: >=3.0.0
deprecatedThe separate `winrt-runtime` PyPI package is no longer needed nor compatible with `winrt-windows-foundation` versions 3.0.0 and above. Its functionality is now integrated directly into `winrt-*` packages.
fix
Uninstall `winrt-runtime` if it's installed and rely solely on `winrt-windows-foundation` (and other specific `winrt-*` packages) for runtime components.
affects: >=3.0.0
gotchaBefore `v3.1.0`, `IIterator.__iter__()` contained critical bugs that could lead to crashes or incorrect object returns, especially when iterating over WinRT collections.
fix
Upgrade to `winrt-windows-foundation v3.1.0` or a later version to ensure correct iteration behavior.
affects: <3.1.0
breakingThe `box` and `unbox` helper functions, previously found in `winrt.windows.foundation.interop`, were moved to `winrt.system` and split into type-specific functions (e.g., `box_int32`, `unbox_string`) in `v3.0.0`.
fix
Update imports to `from winrt.system import box_int32` (or the appropriate type) and call the new type-specific functions.
affects: >=3.0.0
gotchaThe `v2.0.0` release was never published to PyPI due to compilation issues. If you intend to use a `v2` release, `v2.0.1` was the first stable and published version.
fix
Do not attempt to install `winrt-windows-foundation==2.0.0`. Use `winrt-windows-foundation==2.0.1` or a later compatible version instead.
affects: 2.0.0
Upgrade
Version history
3.2.1latest on PyPI · released Jun 6, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources