This release is a pre-release and may not be stable for production use.
windowsml
Python bindings for the Windows AI Machine Learning API.
This package provides a ctypes-based wrapper around the WinML flat C API, enabling Python applications to discover and manage execution providers and model catalogs for ONNX Runtime on Windows.
Installation
pip install windowsml
ONNX Runtime dependency
To automatically install a matching version of ONNX Runtime, use the
with-ort extra:
pip install windowsml[with-ort]
If you choose not to use [with-ort], you must install a compatible version
of onnxruntime separately and ensure it matches the version expected by this
package.
Quick Start
EP Catalog — discover execution providers
from windowsml import EpCatalog
with EpCatalog() as catalog:
for ep in catalog.find_all_providers():
print(f"{ep.name} v{ep.version} - {ep.ready_state.name}")
# Ensure the provider is ready (downloads/installs if needed)
ep.ensure_ready()
Model Catalog — discover and download models
from windowsml import ModelCatalogSource, ModelCatalog
with ModelCatalogSource.create_from_uri("https://example.com/catalog.json") as source:
with ModelCatalog([source]) as catalog:
for model in catalog.find_all_models():
print(f"{model.name} v{model.version} by {model.publisher}")
print(f" Size: {model.model_size_in_bytes} bytes")
print(f" EPs: {model.execution_providers}")
API Reference
Enums
EpReadyState—Ready,NotReady,NotPresentEpCertification—Unknown,Certified,UncertifiedCatalogModelStatus—Ready,NotReadyCatalogModelInstanceStatus—Available,InProgress,Unavailable
Classes
EpCatalog()
Context manager for the EP catalog.
| Method | Description |
|---|---|
find_all_providers() |
Returns list[ExecutionProvider] |
close() |
Release the catalog |
ExecutionProvider
Handle to a discovered EP (owned by the catalog).
| Property / Method | Type |
|---|---|
name |
str |
version |
str |
package_family_name |
str |
library_path |
str |
package_root_path |
str |
ready_state |
EpReadyState |
certification |
EpCertification |
ensure_ready() |
Blocks until ready |
ensure_ready_async(on_complete, on_progress) |
Returns AsyncOperation |
ModelCatalogSource
Represents a catalog source endpoint. Create via static factory methods.
| Method / Property | Description |
|---|---|
create_from_uri(uri) |
Create from a URI or local path (blocking) |
create_from_uri_async(uri, ...) |
Create from a URI (async) |
create_from_uri_with_headers(uri, headers) |
Create with custom HTTP headers (blocking) |
create_from_uri_with_headers_async(uri, headers, ...) |
Create with custom HTTP headers (async) |
id |
str — source identifier |
uri |
str — source URI |
close() |
Release the source |
ModelCatalog(sources)
Context manager for the model catalog. Created from a list of ModelCatalogSource.
| Method / Property | Description |
|---|---|
execution_providers |
list[str] — configured EPs |
set_execution_providers(providers) |
Set EP filter for queries |
get_available_model(id_or_name) |
Returns CatalogModelInfo |
get_available_models() |
Returns list[CatalogModelInfo] |
find_model(id_or_name) |
Find a model (blocking) |
find_model_async(id_or_name, ...) |
Find a model (async) |
find_all_models() |
Find all models (blocking) |
find_all_models_async(...) |
Find all models (async) |
close() |
Release the catalog |
CatalogModelInfo
Metadata about a model in the catalog.
| Property / Method | Type |
|---|---|
id |
str |
name |
str |
publisher |
str |
source_id |
str |
version |
str |
license |
str |
license_uri |
str |
license_text |
str |
uri |
str |
model_size_in_bytes |
int |
execution_providers |
list[str] |
status |
CatalogModelStatus |
get_instance_async(...) |
Returns AsyncOperation → CatalogModelInstance |
get_instance_with_headers_async(headers, ...) |
Returns AsyncOperation → CatalogModelInstance |
close() |
Release the model info |
CatalogModelInstance
A downloaded or local instance of a catalog model.
| Property / Method | Type |
|---|---|
model_paths |
list[str] — local file paths |
model_info |
CatalogModelInfo |
close() |
Release the instance |
AsyncOperation
Returned by async methods. Supports context-manager usage.
| Method | Description |
|---|---|
wait() |
Block until complete |
get_status(wait=False) |
Poll or wait for status |
get_result() |
Extract the typed result (if applicable) |
cancel() |
Request cancellation |
close() |
Release async resources |
Metadata
Release files for windowsml 2.0.297rc0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| windowsml-2.0.297rc0-py3-none-win_arm64.whl | Python 3 | none | Windows ARM64 | Details for windowsml-2.0.297rc0-py3-none-win_arm64.whl |
| windowsml-2.0.297rc0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for windowsml-2.0.297rc0-py3-none-win_amd64.whl |
Total release size: 819.4 kB
Release files / windowsml-2.0.297rc0-py3-none-win_arm64.whl
| Download URL | windowsml-2.0.297rc0-py3-none-win_arm64.whl |
|---|---|
| Size | 407.5 kB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
88c93c13317072b4c577e446b759b968f0e0f21d3d3ebdf5ae683592c621ff96
|
|
BLAKE2b-256 checksum How to use checksums |
ad89297d8d73db4e5bf24a8dc782bad2a7b9b54d2295106f8d1d813c1924abe7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / windowsml-2.0.297rc0-py3-none-win_amd64.whl
| Download URL | windowsml-2.0.297rc0-py3-none-win_amd64.whl |
|---|---|
| Size | 411.9 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
451fb6f0eeb8e21a3ad3ba3e51a89506c4416c6a722cea9c8f44a4caf424d807
|
|
BLAKE2b-256 checksum How to use checksums |
fdd3d5e052bef90d22340163d7695250aa368ad46001ddeee6c92fa2e409ef50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Security for windowsml 2.0.297rc0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.