Skip to main content

wryview

PyPI version License Python versions

| English | 简体中文 |


⚠️ Status: Pre-Alpha

wryview is in early development. The API may change without notice between versions. It was created to serve QtWebView, a Qt webview widget project, and the author is a Rust beginner — the binding code may not be idiomatic. Feedback, bug reports, and contributions (code or ideas) are very welcome.


📖 Introduction

wryview is a Python binding for wry, the cross-platform WebView rendering library used by Tauri. It wraps the full wry API — no event loop, no window management, just the webview.

Built on PyO3 and distributed as pre-compiled wheels (no Rust toolchain required for end users).

✨ Features

  • Zero Event Loop — wryview creates the webview as a child of your window. Your GUI framework owns the event loop. No conflicts, no deadlocks.
  • Full wry API — Navigation, JavaScript execution, IPC (window.ipc.postMessage), custom protocols, cookies, drag & drop, proxy, devtools, zoom, and more.
  • Cross-Platform — Windows (WebView2), macOS (WKWebView), Linux (WebKitGTK). Same API everywhere.
  • Framework-Agnostic — Embed into Qt, tkinter, wxPython, or any native window via HWND/NSView/XID.
  • Pre-Built Wheels — pip install wryview just works. No Rust, no cmake, no system deps (beyond the OS webview).

⬇️ Installation

pip install wryview

Windows: WebView2 Runtime is required (pre-installed on Windows 10 1803+, or download).
macOS: WKWebView is built-in.
Linux: Requires libwebkit2gtk-4.1-dev and related packages (see wry docs).

🧑‍💻 Usage

from wryview import WebView

# Embed as a child of any native window (default)
wv = WebView(parent_hwnd, url="https://example.com", devtools=True)

# Fill an independent window — wry manages size via WM_SIZE / layout
wv = WebView(anchor_hwnd, url="https://example.com", as_child=False)

# 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}"))

# Navigation callback
wv.set_on_page_load(lambda event, url: print(f"{event}: {url}"))

# Custom protocol (intercept requests asynchronously)
def my_handler(method, uri, headers, body, respond):
    # respond(status, headers, body) must be called from any thread
    respond(200, {"Content-Type": "text/html"}, b"<h1>Hello from Python!</h1>")

wv = WebView(hwnd, custom_protocols={"myapp": my_handler}, url="myapp://localhost/")

📦 API Summary

Category Methods
Content load_url, load_html, load_url_with_headers, 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
Geometry set_bounds, bounds
Appearance set_visible, set_background_color, focus
DevTools open_devtools, close_devtools, is_devtools_open
Cookies cookies, cookies_for_url, set_cookie, delete_cookie
Other zoom, print, clear_all_browsing_data

Full constructor options: transparent, background_color, incognito, user_agent, autoplay, initialization_script, proxy, back_forward_gestures, clipboard, and more.

🧩 Used By

  • 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 author is a Rust beginner — if you see something that could be improved, please open an issue or PR. All contributions (code, ideas, documentation) 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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wryview 0.5.4
File Size Uploaded
wryview-0.5.4.tar.gz 47.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for wryview 0.5.4
File
wryview-0.5.4-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
wryview-0.5.4-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details
wryview-0.5.4-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details
wryview-0.5.4-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
wryview-0.5.4-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 2.5 MB

Release files / wryview-0.5.4.tar.gz

Download URL wryview-0.5.4.tar.gz
Size 47.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d8aed847c02fafd59cb13d125232d996895d83ef62a554f24235bf3fbbf42a13
BLAKE2b-256 checksum
How to use checksums
0670646c63994ca4f6520be4916da6f08c635f8cf62f48a80f14e0d8def2396c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release files / wryview-0.5.4-cp310-abi3-win_amd64.whl

Download URL wryview-0.5.4-cp310-abi3-win_amd64.whl
Size 390.1 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
28ff6ed9d8209ce4295327279567e7878af33362929ac8809f3ddafa30c41995
BLAKE2b-256 checksum
How to use checksums
08a46ee819d1f653c54a997652988158bc53fac7fc5f2e3aa1f9c2cc6d95cb29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release files / wryview-0.5.4-cp310-abi3-win32.whl

Download URL wryview-0.5.4-cp310-abi3-win32.whl
Size 354.0 kB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
c5600e301f0150af47a252d7d9f37c6ca9476cfe9bc3991b0d9b74b5bbe2c218
BLAKE2b-256 checksum
How to use checksums
7d83120218f928dbff82231d5fac765d5138964ea1c1aaa3a243e1f223c21662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release files / wryview-0.5.4-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL wryview-0.5.4-cp310-abi3-manylinux_2_34_x86_64.whl
Size 515.7 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
abd24f5fa4ebe5c287123207f09b8081a71c283802732e2aba8aaff4f4daf96e
BLAKE2b-256 checksum
How to use checksums
0c153ca9bc87e936ace992c3009002b447b47f666866d93fcc1d9ed11fb5adb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release files / wryview-0.5.4-cp310-abi3-macosx_11_0_arm64.whl

Download URL wryview-0.5.4-cp310-abi3-macosx_11_0_arm64.whl
Size 558.7 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5534c4f1458ceab7c235a2818b4d73103debc06a043fa0b589a96ab57455e7d8
BLAKE2b-256 checksum
How to use checksums
9a4b878e9f1574dfc95321d5f5b6b3ac38680fb0104a05f300de9def42aeec6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release files / wryview-0.5.4-cp310-abi3-macosx_10_12_x86_64.whl

Download URL wryview-0.5.4-cp310-abi3-macosx_10_12_x86_64.whl
Size 587.9 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
fc6e2cbeec2473542ece86b1815c11b339a7f176b4ade1c1a0c3e17ff26e15ba
BLAKE2b-256 checksum
How to use checksums
b5d8e9ec7c1091969b052d67c78ce2194d6c6e848c2d7829bbec31c1d752e50b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.4 This release

6 release files

0.5.3

6 release files

0.5.2

6 release files

0.5.1

17 release files

0.4.0

17 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page