Skip to main content

Comprehensive Python binding for wry — cross-platform embeddable webview, no event loop required.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wryview-0.4.0.tar.gz (42.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

wryview-0.4.0-cp314-cp314-win_amd64.whl (371.6 kB view details)

Uploaded CPython 3.14Windows x86-64

wryview-0.4.0-cp314-cp314-macosx_11_0_arm64.whl (546.5 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

wryview-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl (576.2 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

wryview-0.4.0-cp313-cp313-win_amd64.whl (371.8 kB view details)

Uploaded CPython 3.13Windows x86-64

wryview-0.4.0-cp313-cp313-macosx_11_0_arm64.whl (546.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wryview-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl (576.0 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

wryview-0.4.0-cp312-cp312-win_amd64.whl (370.6 kB view details)

Uploaded CPython 3.12Windows x86-64

wryview-0.4.0-cp312-cp312-win32.whl (339.2 kB view details)

Uploaded CPython 3.12Windows x86

wryview-0.4.0-cp312-cp312-manylinux_2_35_x86_64.whl (81.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

wryview-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (546.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wryview-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl (574.8 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

wryview-0.4.0-cp311-cp311-win_amd64.whl (372.0 kB view details)

Uploaded CPython 3.11Windows x86-64

wryview-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (546.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

wryview-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl (576.3 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

wryview-0.4.0-cp310-cp310-win_amd64.whl (372.5 kB view details)

Uploaded CPython 3.10Windows x86-64

wryview-0.4.0-cp310-cp310-manylinux_2_35_x86_64.whl (81.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

File details

Details for the file wryview-0.4.0.tar.gz.

File metadata

  • Download URL: wryview-0.4.0.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wryview-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4d48a97d618afc61ce9449fd9ea7ebc4511d0c2783d9d076d188761fbe2d85e0
MD5 c33342ae588712c7c8ff1c582f6c89e5
BLAKE2b-256 b577886a0d7e991d0bbfe58fde354c366349adc008eb2f87b603804e80ddbd9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0.tar.gz:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: wryview-0.4.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 371.6 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wryview-0.4.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0260b67de7c8b4ffe601dbf12d795da5ffb35231c54d114f0b5518cd6c075e91
MD5 f8075bcfdbf275de19b3bf273e1e74d9
BLAKE2b-256 a6098e8048654012e8a2bc861be35ca1794678af95a1ae0394a8f8c90492ffde

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp314-cp314-win_amd64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3caa6d4b357ba4aa56d706b62631de9d7ecc80d05177a4fd01ace722f06efe36
MD5 46714ae558516d35243802ed321d6e6b
BLAKE2b-256 d0c39738c544556640cae0785369e256344159c92c0027d970d69d0b72a2e07e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 457606efa68fa196376c07e67b20dd7b54b463ce82a597b1a3136161fce15f7e
MD5 535946322c20e671047f726b387052f3
BLAKE2b-256 3c7f8f8a1edf825f245aa54dc3d0e5ddf9e27810f0da9a16f90c0e568b33b643

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: wryview-0.4.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 371.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wryview-0.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c456a82b9d242d8acb492bba424c5cb45c50f6e28a54aafe87f0fe672ee064ef
MD5 c70248a464ce21cd2f06f8b2793c11d3
BLAKE2b-256 5aab8b313271d2f87f1925a6ec7522269f354dd4be0fa0dcb8aef30aaab4cc14

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp313-cp313-win_amd64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c1a5072f481f0dcc46c579afddf5b2dde8d5bb10096718c0c813366460238b7
MD5 31b46d334ff1e3a7ce33e9db4845c167
BLAKE2b-256 ec562ec293b603d188d7728f22e1fd8bca06f10bcc1513d89c2f7092d8b20ac1

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 46eddb32659a4237f84cf6f3a715482457824ef97beb2abade204e5aeae53515
MD5 475c7b9e768170b26b1208bbf6cafc18
BLAKE2b-256 3a05bd4910798c8a1ba0c34176d6d8a9db090f1347a29a6be1dc8a9bb4311bb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: wryview-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 370.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wryview-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4d2caab764b4d7194d2a31fc9b90ecf410fa5941c76fc0a82f0dad9833ce9c94
MD5 04a0ce45ee42a12503338bbc21c4d49e
BLAKE2b-256 a600e0d28b561a3a4095d16e3e02ac77502e1ea9c09efc1e63dd310f5a2d0a4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp312-cp312-win_amd64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: wryview-0.4.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 339.2 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wryview-0.4.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 7df7e811b9ce6468cd05b67e813513b27569eb0b5fe2721a9d77a43e68b9b688
MD5 8cf7dd3a89f7a3524dd8c142c9546258
BLAKE2b-256 5d42cc46251e2b84128eaea5bbf96d21cbadb64b59a13b52c7d9ba90b63dfa0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp312-cp312-win32.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 7053ecf53aa17856fb8c465f6cf24a53bea1cec6d003fd23596d6a94236e74d0
MD5 43bbcc6528d4a717d2b1d10f5cd8c4b7
BLAKE2b-256 7247455560ec7d39b2af6e7a84fc779f405a9b3e07c595fbebdc14dc6c3514de

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp312-cp312-manylinux_2_35_x86_64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28ce1202af956a00126ef939ffe7ed523c3074e25a811c9e7cc1320c46d6d68d
MD5 ac02385dd8508cd6d91706566227c170
BLAKE2b-256 4874b1011f6e272c4bf8c19f8320ac3baaa64fa722dd0040787dd418ee0f23f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c3cddcf9da39a6376372e9e209eab0638977ae8f2d2a927220ccde3e1c99656a
MD5 2a7cf391253fcd811bad1fc4e49feb7c
BLAKE2b-256 8f78b164f30b32acaaf57e5e6eb51608e4aa594148e11b20f765c280ca7d1352

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: wryview-0.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 372.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wryview-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c9b0e75f8aef4e2140635f008071caac24d0963c00b38f57c8fe53c3861900f9
MD5 d9f16f3eca7bae2442960f9dbd394c4c
BLAKE2b-256 af520fc9a2c1a6bdd20b6e7a4cceb75813535fc553f37e0ab249c0ac6dbdba8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp311-cp311-win_amd64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34cdb8d8c62cc29c0d84826071b0df243d0adc0122b50fe14e01444b59ffa7e2
MD5 95fc40d619a63f08bbb397a9bd7bfa02
BLAKE2b-256 5e3eb24c2bb8580c3cf6b78983ea256fcdb7b2b03aa72c6d2476f9e03f4553cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f67e298cf5fd8068ca87db84764d396287e13fb6203ae444ebf39fea373efb0a
MD5 b1462b1800830e583ef1284a4ceeacfc
BLAKE2b-256 243a17ee64102b9d65d4eb5de607cdd9623382f171e9b2a1e4b994307968e9e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: wryview-0.4.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 372.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wryview-0.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 826f6c0ba8cd38b074bc776c93ef6a7e0b196120accbfb4a6f74a5cbda423b60
MD5 92b9a8753ba58e156a9527c2937ec610
BLAKE2b-256 02d3bfec17297dbaf73f8a9b29871b1278e222f6b9ad25c05261572939b9e6e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp310-cp310-win_amd64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wryview-0.4.0-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.4.0-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 43a599376dab6c6d5576db8a402a45e37e623650e08a16294edea2b1d568e801
MD5 2db53677c0f32733882b2d053bc92d3b
BLAKE2b-256 33707ece8a57cc3699d190892dc5cfedfe1cc04a9ba08fee7e88526d8f8ddec9

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.4.0-cp310-cp310-manylinux_2_35_x86_64.whl:

Publisher: publish-to-pypi.yml on xiaosuawa/wryview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page