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.3.1.tar.gz (40.9 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.3.1-cp314-cp314-win_amd64.whl (359.3 kB view details)

Uploaded CPython 3.14Windows x86-64

wryview-0.3.1-cp314-cp314-macosx_11_0_arm64.whl (534.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

wryview-0.3.1-cp314-cp314-macosx_10_12_x86_64.whl (564.1 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

wryview-0.3.1-cp313-cp313-win_amd64.whl (359.4 kB view details)

Uploaded CPython 3.13Windows x86-64

wryview-0.3.1-cp313-cp313-macosx_11_0_arm64.whl (534.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wryview-0.3.1-cp313-cp313-macosx_10_12_x86_64.whl (564.0 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

wryview-0.3.1-cp312-cp312-win_amd64.whl (358.7 kB view details)

Uploaded CPython 3.12Windows x86-64

wryview-0.3.1-cp312-cp312-win32.whl (328.0 kB view details)

Uploaded CPython 3.12Windows x86

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

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

wryview-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (533.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wryview-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl (563.1 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

wryview-0.3.1-cp311-cp311-win_amd64.whl (360.1 kB view details)

Uploaded CPython 3.11Windows x86-64

wryview-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (534.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

wryview-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl (564.4 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

wryview-0.3.1-cp310-cp310-win_amd64.whl (360.6 kB view details)

Uploaded CPython 3.10Windows x86-64

wryview-0.3.1-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.3.1.tar.gz.

File metadata

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

File hashes

Hashes for wryview-0.3.1.tar.gz
Algorithm Hash digest
SHA256 115bfb2e03640b6bc83909f12a03f4055a829f7eb5b5b4cb52c07ef7cff76adb
MD5 86cbedda23d2611dee810cd4ed2d9e71
BLAKE2b-256 80b60a72d678d08cf5c2f3449e745722886b40b6813294a95a9f0ea915ea8332

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 359.3 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.3.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 52594dd4ee3cbdbe4f6c23e6f3e12d1d0d72ced92884066745f8de805c594383
MD5 1ddca7f11081cef5e3bb6126f8b718fb
BLAKE2b-256 0b0cabb473d21cf18436409a5ee82dea4bdc1af8e28d82fd4d9b62633cfe323b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c288f76725e10beba661ad810f782c4eccb39b24062a80f0b297007070c22c7b
MD5 4795ee533de6a62acc0a3baa22f5579d
BLAKE2b-256 fc2473a9482b55ec86129aab96d6d3eae516342f6965a68cf3b8107a3caae82e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 de02922db055461846be63470e0ba9e177368cd2c0ebe6834e263da4bd91f9ef
MD5 7faef553efde1022547b75b9f31a644c
BLAKE2b-256 6d0c4c71acd170f7e6cbd719df46fdf0312c7ecddf0a3cf3a99f4be53bed963d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 359.4 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.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fffdfa4b568f7a3935d72e23296126f0cc680b48718febb250c7659140916d72
MD5 809bca5d9a59cfa45c01220c1c5713f0
BLAKE2b-256 c7f17f28ab105727a94205392a38890953e01a3af034680b2442f99731e8ee55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ff5d9b0f68312eaeaaf380d3c319ce58a57feeaacac7932812ed902eae2bfac0
MD5 1b938ae99f6ef807a675a906f8700768
BLAKE2b-256 84352780bca36a30e9ec1172c33787f907208ce2604068689188a8e660b8fb83

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e35e9059eabcd8f90e4812133990d67e8f17663280f732d20b6d8d689131955e
MD5 2070f3bb0bb3e0383d82a6fc0d4ff89e
BLAKE2b-256 f80a02cd20cfac94ddb522746ffbc9502e6d9a5c5d58bde331cb2c01a2b310f5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 358.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.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 293969255a49d9d00414e98c793c2ea2a8a5c9e89bf05b857594c6e578150147
MD5 1348646766fa2fa3867edb74d6c449b1
BLAKE2b-256 c8eaf11e05cc692aa9edfc7abaf72005dc5c57790cd9434bd3388fea804dea3e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.1-cp312-cp312-win32.whl
  • Upload date:
  • Size: 328.0 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.3.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 b4b60bf807986967bfadf3cadcfc06d5f2b301bd85717f0cd2cfdd347fa036d0
MD5 e2320ab7f03cee20f51f5f1e2b9554e3
BLAKE2b-256 f50ce233cfcc585e2e553c3681dbb67c4d49f99ea761cad4cd176d5203c173e0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0e820c8ddfc9215a13ea02b713909e3ee78a42331623d1a3864e8279732945ab
MD5 511c2cb7b8007709f0c176dccec0f75a
BLAKE2b-256 3291fe65fb1e9f764cee0ecee4d8eedcb301936bcac7f8726145f5e61d400e61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9e134ea69062634d67b9ba9f605f40ce0d811b1a7795bb26735b96096d64127
MD5 26840cad2047d3ed2e91c92a1709a74e
BLAKE2b-256 ee9e060d627cb6eac50caf1e7843721723897048823093693022deb1cff525b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a9db562324ae927b7759792b3c1a63aa7e17be32ee6e82785e0ac609957894d5
MD5 022483e7d396376e410da386e898e163
BLAKE2b-256 1bcec8b27f277ec482ae09a64d0cc31d5dda23acc700901e41e471ff9fee26c1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 360.1 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.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 75006fd8859a73c29da8c9136fe6e6ccad97186b3fc69c787d852102ea68bfb0
MD5 736bcc9d29d9815dfb74dadbbbf38dde
BLAKE2b-256 1834cccd75256fda60ce217d3aa8a527eb9358283d77b10cf1c6d04f6ab384b7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee18c022db743551f1f3d1033ac9cb7ac1e5040b247d6eb5951a3c96df660500
MD5 dc5c03a4c4ae9ad7642f5e638d84b124
BLAKE2b-256 32b6d78c5ebb1ce891832419959b0e7613536215e585f9c0cabf614ba0879f49

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 607ea2b7c1ac33a7bc1683f28b1b7885782a9267a925b4b08c8cab2246be57fd
MD5 0f1e48a701eb7ca095853dd5baa0cc14
BLAKE2b-256 27008896dbf35ae341b8d6d0c4153de1f6b0e1e58f9130464574ebdb78ef002c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 360.6 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.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 92b8f678ea98ef43ee438ba5def6d65ab23384e0e09c436e2a978cb09f463ce9
MD5 3e95c6d653d3e9259222e9c59f783f87
BLAKE2b-256 98634a151eea4572e0b58b05cc55ffdef1289c80f3c8abf2a28045dd6deaef3c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.1-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 d4929bab04ebe4c43e9e04252879a43d4cdc11f6928d5b6bf0387981e2fb0d4f
MD5 b9fef789b170674ed526a9a23c9e6ae8
BLAKE2b-256 00a69655015f7763f2d55cd92bf00ccfaf1fd115d87f584d9721ad18ef180766

See more details on using hashes here.

Provenance

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