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.3

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.3
File Size Uploaded
wryview-0.5.3.tar.gz 46.8 kB Details

Built distributions (wheels)

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

Total release size: 2.4 MB

Release files / wryview-0.5.3.tar.gz

Download URL wryview-0.5.3.tar.gz
Size 46.8 kB
Tags Source
SHA-256 checksum
How to use checksums
420b8938fe629df449044b443b1e0f377a47295f117a1ed04c99c84b6a7cac55
BLAKE2b-256 checksum
How to use checksums
5906613dde8eee06afa8728a36bfd05609b1af26c4b50bf62ae5c621fe685b14
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 5, 2026.

Transparency log

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

Download URL wryview-0.5.3-cp310-abi3-win_amd64.whl
Size 387.5 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
93ff5a501ca9567e010c547219359a162b4f14aeff4899997d84e9cfda3c4bac
BLAKE2b-256 checksum
How to use checksums
04481c3291c9f3093cd7d074d61eae5684874eec65d66c57bfec5e4b3be162f0
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 5, 2026.

Transparency log

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

Download URL wryview-0.5.3-cp310-abi3-win32.whl
Size 352.0 kB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
441123b1cf233cc4df9d2f4b6190fc4d0e4000ed6c5c547f59a2ecad189e4489
BLAKE2b-256 checksum
How to use checksums
e920b323de06c4d0b70ae9dffdfc9718ed5a529ed531736397983e89e0e9b623
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 5, 2026.

Transparency log

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

Download URL wryview-0.5.3-cp310-abi3-manylinux_2_34_x86_64.whl
Size 513.4 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
540e4e46978e1a2bbb984b6bb1527db65fd3a2664d9eb89468f1bea49d0c68e1
BLAKE2b-256 checksum
How to use checksums
4e6fc727769f882e4180fc866f8d45f9aec8e821e5e7932e6dd116d394db1bb6
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 5, 2026.

Transparency log

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

Download URL wryview-0.5.3-cp310-abi3-macosx_11_0_arm64.whl
Size 555.2 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8d60f8a3303366fe864e1143a109535ecc035fb26ae21b88876ef12db595059d
BLAKE2b-256 checksum
How to use checksums
800ff410239fafd84bf9e074effa149cb710eb57d5d8bc179fde2445b54ddd9a
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 5, 2026.

Transparency log

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

Download URL wryview-0.5.3-cp310-abi3-macosx_10_12_x86_64.whl
Size 584.9 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
09027c34632ba20104a5e29424ad1540a8e04d4d680765d3b4c379d41f6329d9
BLAKE2b-256 checksum
How to use checksums
e167b63bb8196fa1dbae5284363bbacd60dd3008da40fb7603363f8c152f614b
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 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.4

6 release files

This release

0.5.3 This release

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