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

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

# 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.2.0.tar.gz (37.2 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.2.0-cp314-cp314-win_amd64.whl (353.2 kB view details)

Uploaded CPython 3.14Windows x86-64

wryview-0.2.0-cp314-cp314-macosx_11_0_arm64.whl (454.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

wryview-0.2.0-cp314-cp314-macosx_10_12_x86_64.whl (473.8 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

wryview-0.2.0-cp313-cp313-win_amd64.whl (353.5 kB view details)

Uploaded CPython 3.13Windows x86-64

wryview-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (455.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wryview-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl (473.8 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

wryview-0.2.0-cp312-cp312-win_amd64.whl (352.7 kB view details)

Uploaded CPython 3.12Windows x86-64

wryview-0.2.0-cp312-cp312-win32.whl (322.5 kB view details)

Uploaded CPython 3.12Windows x86

wryview-0.2.0-cp312-cp312-manylinux_2_35_x86_64.whl (81.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

wryview-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (454.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wryview-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl (473.1 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

wryview-0.2.0-cp311-cp311-win_amd64.whl (353.7 kB view details)

Uploaded CPython 3.11Windows x86-64

wryview-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (454.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

wryview-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl (473.5 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

wryview-0.2.0-cp310-cp310-win_amd64.whl (354.1 kB view details)

Uploaded CPython 3.10Windows x86-64

wryview-0.2.0-cp310-cp310-manylinux_2_35_x86_64.whl (81.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

File details

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

File metadata

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

File hashes

Hashes for wryview-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3ab99c7afee48deed2f668e80ba7a2a3503eb961f229394b70051b454babf3ed
MD5 5b83439697f57d9efccaccb10627868c
BLAKE2b-256 1f05bac28d7a19c500bac7cec42fc3f1dc22ca0274d7e56a807f4bfaecacd9d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: wryview-0.2.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 353.2 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.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 059d3f17be3a6a2ec80f3a9f4ac3b98a282dfcdeb27a9cbe429124b42e8da6be
MD5 d588a9abc8fcb6649aa5e12622ba59b9
BLAKE2b-256 908c6859331057bc085fab40ba081a7cac5443dfa1563869bddd6c7e2ce72f18

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b40923bb33c37cabca9584dab352dc8656cfa78cb75a786858eb77e31cf3a0fe
MD5 ed450f8a86bffda3565387f371ee0f2a
BLAKE2b-256 0b793325b5d4da908b239d58595c9f1f8f2d6259ec07912b349f8db2269de9e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dc7dc30703e18d0a9102fa56979bfb9458312c5ef85396fdb4d8245ea16a2ffa
MD5 3037d54a6c5d61ae8045d2d0d23553d0
BLAKE2b-256 7c6c8b47d70324306f5c879c0e79e601b74462e24312472ba51af60f72105d93

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: wryview-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 353.5 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.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 90099ce7db8af5e4f26bdda92f688f79e7237f692b7a47e19a080a71505f6459
MD5 be4116b753e91385c71108999e10b5db
BLAKE2b-256 958cd9c1b046472b305f2451b4de0544a9e43bd3953f6cadc49db456c3db2b9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d4e48875587ad17d7fb508de6e72d5e8621da7f5891124be2e363d05950d2eb
MD5 2f20fbc3908a0f8c6c2fcace2b4e1d1b
BLAKE2b-256 dcd110110e9693e4453971db9562e1e1bc120d63dc98a8082443ecf6ba3c85d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0b5c017d8aad87dbbd5e7b4374f45e02d1f12236c738614cd24bb7a1e9c5f1ad
MD5 a87655bdda0759eb05b9ace6d95c0b06
BLAKE2b-256 c257b39dc8f974525469312300e2e71119acc06b2403054e267f69b4554d463e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: wryview-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 352.7 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.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3c21c70f9a4dbfacacbfbef11186d0a5e62ae7d6d3e818e42be51edc3b906aa7
MD5 ca5f95f2b0e040e207fa28d9fcb29763
BLAKE2b-256 c0c7f16fe225914a0f46e6d519074a07724528994be63d39284ed67e50d8c42b

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: wryview-0.2.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 322.5 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.2.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 dae00831aad526192affdb3633e59b8cbafb09cc07dfdfa0a646b64817c7d74b
MD5 22db4a07967322179ad21ae15fa6cebc
BLAKE2b-256 293e8bcfba0d1f728eec61661b00b5641893d36a265768af8fdc95f696c71130

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 3a9c560ad680e8648bcd36fa2041f3f99dd8833604d2782be8c734657e0c4b3c
MD5 e6b1578929e82487f4243aa711f6e253
BLAKE2b-256 44e41ba7b0d6f8b2c9a2c6b96f6efba9561476fdd0d95fa63f3a2226d62d07e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22d3cf55f807aed75729651893dbc3b61335f4b2a67388ace81c0409322ada0c
MD5 156874aae4f475bb3fa4bc788b4c9d54
BLAKE2b-256 24f087a08db0fe4c129942a5070f289da7fd669906f2a18740737a061a486f91

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 86845cfdc4ee2acaff3969b85e66a441003dcb90704a5b288c551f552a620e95
MD5 cd7e6095c98e27e6625efa2e235543eb
BLAKE2b-256 6c7964270b849b3642397b3fb10e2bc0c47f26be9466f60b144c1c9209311475

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: wryview-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 353.7 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.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 50e08592b9c035145b3571df9e855f341b01c22974a8247e0d708ecfa14d4d98
MD5 1574a6b20091312d150990865ef52670
BLAKE2b-256 6d25c01e2ff0c000b5395312d5ed885ce8ea2665932c12fef5637518f18bc74e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7ee3c163b6b72f86398bcafaf857aa242c520b762b2f129842f3852ad24db34
MD5 76a0971d36413c5afbf065778234e912
BLAKE2b-256 cf44e55507e6e5f7c11799e646b05dccc56c7e31effd140ec13b2b7a859740dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4d8d9fe90d53bf7dd16653b6532cbe9c322138c0caa44f56925883029ddb30ec
MD5 d42cd510635a739c84f95693317dc350
BLAKE2b-256 6eb21eeb50e13cbc3edb1bd6e5a2e19de3eb9983c702b66803ddf3d9ed0e5f3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: wryview-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 354.1 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.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8ac6d4cc82ca087d645e0cda91a283b4b5c1a3b38ad3c21529f050e762bdf915
MD5 3ac32344d64eb0982d4a6d4691cf44ce
BLAKE2b-256 543151c165af459caba74a3820584f6a72c87243cd822264fc73293cfc009b53

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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.2.0-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for wryview-0.2.0-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 a5a34f4caf0d8157f1179e184a5e8a7232c6563d5509d2d54f57597a0fcbf253
MD5 3005064ae85d90a1223829dcaaefa839
BLAKE2b-256 dc205be8c1b58b332ee2283b99ef7d90bd3270be31d4e27c09156c0935d155d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for wryview-0.2.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