wryview
| English | 简体中文 |
Status: Alpha
wryview is a small, focused Python binding for wry. It started as the WebView layer of QtWebView and is now a standalone component used by QtWebView and LumiView. The Python API is still 0.x: minor releases may change it. Bug reports and contributions are welcome.
📖 Introduction
wryview embeds wry's WebView into a window owned by your application. It does
not create a top-level window and does not run an event loop — your GUI
framework keeps its own loop and passes a native parent handle. With
as_child=False, wry keeps the WebView sized to the host window; in the default
child mode the WebView is a child control and you manage its bounds.
Built on PyO3 and distributed as prebuilt wheels, so wheel users do not need a Rust toolchain.
💡 Looking for a Full Desktop Framework?
wryview is a component, not a framework: it gives you the webview, but you bring your own window, event loop, and UI scaffolding. Embedding a webview into an existing Qt/tkinter/native window? wryview is for you.
Starting a new desktop app from scratch? Try LumiView — a Pythonic desktop app framework built on wryview. It adds native windows, an event loop, a JS bridge (IPC), custom protocols, and an async-first API, all out of the box. wryview powers LumiView's WebView engine, so you get the same rendering core with none of the plumbing.
✨ Features
- No event loop of its own — your framework owns the loop. On Linux, when
the host loop is not GTK (for example Qt's xcb backend), call
pump_events()periodically andensure_gtk_init()once before creating the first WebView (both are exported bywryview). - Broad wry coverage — navigation, JavaScript evaluation, IPC, custom
protocols, cookies, drag & drop, proxy, DevTools, zoom, downloads, themes
(Windows), shared
WebContext, and more. Platform-specific wry builder extensions (macOSaccept_first_mouse, Windowsbrowser_accelerator_keys, Linuxextension_path) are not wrapped yet. - Cross-platform — Windows (WebView2), macOS (WKWebView), Linux (WebKitGTK 4.1). The Python API is the same; platform-specific details are noted below.
- Framework-agnostic — embed into Qt, tkinter/wxPython (platform-dependent),
or any native window via HWND / NSView / X11 XID. On Wayland, pass a GTK
container and
parent_hwnd_kind=WindowHandleKind.Gtk. - Prebuilt wheels —
pip install wryviewfor CPython 3.10–3.15, including free-threaded 3.15 (abi3.abi3twheels).
⬇️ Installation
pip install wryview
Windows: WebView2 Runtime is required (often preinstalled on Windows 11 and
recent Windows 10, or download).
macOS: WKWebView is built in.
Linux: WebKitGTK 4.1 and GTK 3 runtime libraries are required
(Debian/Ubuntu: libwebkit2gtk-4.1-0, libgtk-3-0; Fedora:
webkit2gtk4.1, gtk3). The -dev packages are only needed when building
from source.
Python: 3.10+; the 3.15 wheels support both the GIL and free-threaded
builds. Free-threaded 3.14 has no wheels — the abi3t stable ABI starts at
3.15. Building from source requires Rust 1.85+ (PyO3 0.30).
🧑💻 Usage
from wryview import WebView, WindowHandleKind
# Embed as a child of a native window (default)
wv = WebView(parent_hwnd, url="https://example.com", devtools=True)
# Fill an independent window — wry keeps the webview sized to the host window
wv = WebView(anchor_hwnd, url="https://example.com", as_child=False)
# Wayland: the parent is a GTK container, not an X11 XID
# wv = WebView(gtk_container_ptr, parent_hwnd_kind=WindowHandleKind.Gtk, url=...)
# JS execution
wv.eval_js("document.body.style.background = '#333'")
# JS → Python IPC (JS side: window.ipc.postMessage('hello'))
wv.set_ipc_handler(lambda msg: print(f"JS says: {msg}"))
# Page lifecycle
wv.set_on_page_load(lambda event, url: print(f"{event}: {url}"))
# Custom protocol: request/response headers are lists of (name, value) pairs
def my_handler(method, uri, headers, body, respond):
# Call respond exactly once. It may be called from any thread.
respond(200, [("Content-Type", "text/html")], b"<h1>Hello from Python!</h1>")
wv = WebView(parent_hwnd, custom_protocols={"myapp": my_handler}, url="myapp://localhost/")
Linux embedding note: WebKitGTK renders on the GLib main context. If the host loop is not GTK, call
pump_events()periodically (for example from a 16 ms timer). Callensure_gtk_init()once before creating the first WebView. Both helpers are exported bywryview.
📦 API Summary
| Category | Methods |
|---|---|
| Content | load_url, load_url_with_headers, load_html, reload, url |
| JavaScript | eval_js, eval_js_with_callback |
| IPC | set_ipc_handler, clear_ipc_handler |
| Callbacks | set_on_navigation, set_on_page_load, set_on_title_changed, set_on_new_window, set_drag_drop_handler, set_on_download_started, set_on_download_completed |
| Geometry | set_bounds, bounds, reparent |
| Appearance | set_visible, set_background_color, set_theme (Windows), focus |
| DevTools | open_devtools, close_devtools, is_devtools_open |
| Cookies | cookies, cookies_for_url, set_cookie, delete_cookie |
| Lifecycle | close |
| Other | zoom, print, clear_all_browsing_data |
| Linux helpers | pump_events, ensure_gtk_init |
Constructor options: width, height, url, html, transparent,
background_color, visible, devtools, incognito, user_agent,
focused, autoplay, javascript_enabled, hotkeys_zoom,
initialization_script, ipc_handler, on_navigation, on_page_load,
on_title_changed, on_new_window, drag_drop_handler, custom_protocols,
proxy, back_forward_gestures, clipboard, data_directory,
web_context, headers, https_scheme, default_context_menus, theme
(Windows), on_download_started, on_download_completed, as_child,
parent_hwnd_kind.
WebContext can be shared across WebViews to share cookies, cache and
storage. See python/wryview/_core.pyi for the complete signatures.
🧩 Used By
- LumiView — A Pythonic desktop app framework (native windows, event loop, JS bridge, custom protocols) with wryview as its WebView engine. The recommended way to build a complete desktop app on wryview.
- QtWebView — A cross-platform webview widget for Qt (PySide/PyQt), powered by wryview. Embeds a wry WebView as a native child window inside any Qt widget, with a seamless JS bridge and WSGI support.
🤝 Contributing
The Rust layer is intentionally small (src/lib.rs); the Python package lives
in python/wryview. Contributions of code, documentation, and ideas are
welcome.
License
Copyright (c) 2026 Xiaosu.
Distributed under the terms of the Mozilla Public License Version 2.0.
Metadata
Release files for wryview 0.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wryview-0.5.5.tar.gz | 51.2 kB | With provenance | Details for wryview-0.5.5.tar.gz |
Built distributions (wheels)
Total release size: 4.9 MB
Release files / wryview-0.5.5.tar.gz
| Download URL | wryview-0.5.5.tar.gz |
|---|---|
| Size | 51.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae00a5a5ba9e9a4a19115f75cc5385d94ca2022b16c5c4e07b0e12dffc51b221
|
|
BLAKE2b-256 checksum How to use checksums |
7b41167810a04ee7039f000e168a552ec814ae355a8e23d10b8bf3b8271bd9e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp315-abi3.abi3t-win_amd64.whl
| Download URL | wryview-0.5.5-cp315-abi3.abi3t-win_amd64.whl |
|---|---|
| Size | 399.5 kB |
| Tags | CPython 3.15 Windows x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
77944db6c44e7c51501a24d86097c7d4061b9990cfe128bc5a7c41be8e80f389
|
|
BLAKE2b-256 checksum How to use checksums |
51d3369d0bf0b415cb7276c0ee95577d31059153676cecacd1c2f9930585f630
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp315-abi3.abi3t-win32.whl
| Download URL | wryview-0.5.5-cp315-abi3.abi3t-win32.whl |
|---|---|
| Size | 362.6 kB |
| Tags | CPython 3.15 Windows x86-32 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
c7f9a8c302af190f412a0e945965e8886140f97be086183da8095f962e9ce2f6
|
|
BLAKE2b-256 checksum How to use checksums |
c21657faa91d7bb2154d42e04b796b181df23a4ddbcb450d3037ecd1890f0f02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp315-abi3.abi3t-manylinux_2_34_x86_64.whl
| Download URL | wryview-0.5.5-cp315-abi3.abi3t-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 521.9 kB |
| Tags | CPython 3.15 Linux glibc 2.34+ x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
87ccf3184568f719fb64f6ba752980d0f4ba4f72f80461cb7c84f09c2e3a3623
|
|
BLAKE2b-256 checksum How to use checksums |
ca69a5aedf32b35d37c4c5a6376217f5564e31a31ca45e43f58f1c3fee6fbaaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp315-abi3.abi3t-macosx_11_0_arm64.whl
| Download URL | wryview-0.5.5-cp315-abi3.abi3t-macosx_11_0_arm64.whl |
|---|---|
| Size | 565.1 kB |
| Tags | CPython 3.15 abi3 abi3t macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
df63e3002e3b73795eece19dc22ef99c3e79fe218b28816077b1c1094a5446a5
|
|
BLAKE2b-256 checksum How to use checksums |
74b010852ea7eda5d54085c47ed8178737adadb520fbe88d335014898c4c1ff3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp315-abi3.abi3t-macosx_10_12_x86_64.whl
| Download URL | wryview-0.5.5-cp315-abi3.abi3t-macosx_10_12_x86_64.whl |
|---|---|
| Size | 592.9 kB |
| Tags | CPython 3.15 abi3 abi3t macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c398733d417f5fb27f2cfae4f61436b56e887b2138aa5dc8f9f77a60d4a06c65
|
|
BLAKE2b-256 checksum How to use checksums |
70a357baf1d9a317822b00bce41ee35602e161c5eba78313cb6f6f1287d8b18f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp310-abi3-win_amd64.whl
| Download URL | wryview-0.5.5-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 391.0 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6c7b38df73672b9bb49067d3cde539bf9ab0c6e6829587398bd6c9831fbae1cc
|
|
BLAKE2b-256 checksum How to use checksums |
1f9b43733f912b3470ad32bcde276f725eb9c9ad510a1f06a593bcce2efc052f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp310-abi3-win32.whl
| Download URL | wryview-0.5.5-cp310-abi3-win32.whl |
|---|---|
| Size | 356.7 kB |
| Tags | CPython 3.10 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
a846b42ac9dbc6fab170974decb38f886c4f2397f8171d05454a359c876378ab
|
|
BLAKE2b-256 checksum How to use checksums |
83be17ac3cc0d022ded08717b367b673e221d2844b6b309208e5ec7514cb70eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | wryview-0.5.5-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 514.1 kB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
809386418e03a68e9fbd7476955a8b9eb300622435b0a39ab977403567556b47
|
|
BLAKE2b-256 checksum How to use checksums |
c8002187854efeb312015dd2144c44b4da36a4be7a71d08de4b461a0a06599cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | wryview-0.5.5-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 558.0 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
16fb07f67577bf0972b45e62462a6923a9ce1594cf944a97c2c4f01e37f908fc
|
|
BLAKE2b-256 checksum How to use checksums |
bc9ff4c3421014239ac945ed6d323022b3051ae4b336a93e5d6a42ab0ba0b876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / wryview-0.5.5-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | wryview-0.5.5-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 578.7 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
e141acd1f5a7e005cd75fcc48be6fa70f4f2112d358ce8e14c75209a97bbfe1f
|
|
BLAKE2b-256 checksum How to use checksums |
cac70f9a69201f884a23f29ba9b43f0ccccd9d5ddf4121b1313fa81a0fb26954
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logSecurity for wryview 0.5.5
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.
Full provenance
All 11 files in this release have been uploaded with provenance metadata.
Attestation for wryview-0.5.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logA 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.