Registry / http-networking / winrt-windows-devices-radios

winrt-windows-devices-radios

JSON →
library3.2.1pypypiunverified

winrt-windows-devices-radios is a Python projection of a subset of Windows Runtime (WinRT) APIs, specifically those related to managing wireless radios like Wi-Fi and Bluetooth. It allows Python applications to interact with system hardware for radio control on Windows. Part of the broader `pywinrt` project, it is currently at version 3.2.1 and receives regular updates corresponding to new Windows SDK releases and `pywinrt` core improvements.

pip install winrt-windows-devices-radios
INSTALL
IMPORT
SIG · WINRT-WINDOWS-DEVI
W
winrt-windows-devices-radios
http-networkingpythonv3.2.1
Install
—
Import
—
Disk
—
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.9–3.13
musl
3.9–3.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.10–3.920 runs
build_error
glibc
py 3.10–3.920 runs
build_error
Code
Verified usage

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

Radio
✓ from winrt.windows.devices.radios import Radio
✗ import winrt.windows.devices.radios.Radio
WinRT types are typically imported directly from their module path.
RadioState
✓ from winrt.windows.devices.radios import RadioState

This quickstart demonstrates how to enumerate available wireless radios (Wi-Fi, Bluetooth) and their current state using the WinRT API. It requires an `asyncio` event loop as most WinRT operations are asynchronous.

import asyncio from winrt.windows.devices.radios import Radio, RadioState async def list_radios(): try: radios = await Radio.get_radios_async() if not radios: print("No radios found.") return print(f"Found {len(radios)} radios:") for radio in radios: print(f" Name: {radio.name}") print(f" Kind: {radio.kind}") print(f" State: {radio.state}") # Example of setting state (requires appropriate user permissions) # if radio.state == RadioState.ON: # print(f" Attempting to turn OFF {radio.name}...") # # await radio.set_state_async(RadioState.OFF) # # print(f" Turned OFF {radio.name}") except Exception as e: print(f"An error occurred: {e}") print("Ensure you are running on Windows with necessary permissions.") if __name__ == "__main__": # os.environ.get('WINRT_DEBUG', 'false') # Example for auth check if needed asyncio.run(list_radios())
Debug
Known issues
breakingVersion 3.0.0 introduced significant breaking changes, including a new `winrt.runtime` module, changes to boxing/unboxing functions, and how `winrt.system.Object` methods like `as_()` are used. Refer to the migration guide for details.
fix
Consult the `pywinrt` migration guide for updating code from v2.x to v3.x. Key changes include importing `box_value` from `winrt.system` and using `obj.as_(TargetType)`.
affects: >=3.0.0
gotchaThis library is a projection of Windows Runtime (WinRT) APIs and is therefore strictly Windows-only. Attempting to install or run it on non-Windows operating systems will result in `ImportError` or `ModuleNotFoundError`.
fix
Ensure your development and deployment environment is running Windows. For cross-platform solutions, consider platform-agnostic alternatives.
affects: All versions
gotchaMany WinRT methods are asynchronous, indicated by names ending in `_async` (e.g., `get_radios_async`). These methods return `IAsyncOperation` or `IAsyncAction` objects and must be `await`ed within an `asyncio` event loop.
fix
Always use `await` with WinRT async methods and ensure your application runs within an `asyncio` event loop (e.g., by calling `asyncio.run()` for top-level async functions).
affects: All versions
Upgrade
Version history
3.2.1latest on PyPI · released Jun 6, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
28
OpenAI (training)
1
Resources
winrt-windows-devices-radios — pip install winrt-windows-devices-radios · libregistry