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.0.tar.gz (39.7 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.0-cp314-cp314-win_amd64.whl (358.0 kB view details)

Uploaded CPython 3.14Windows x86-64

wryview-0.3.0-cp314-cp314-macosx_11_0_arm64.whl (458.5 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

wryview-0.3.0-cp314-cp314-macosx_10_12_x86_64.whl (478.1 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

wryview-0.3.0-cp313-cp313-win_amd64.whl (358.2 kB view details)

Uploaded CPython 3.13Windows x86-64

wryview-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (458.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wryview-0.3.0-cp313-cp313-macosx_10_12_x86_64.whl (478.2 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

wryview-0.3.0-cp312-cp312-win_amd64.whl (357.4 kB view details)

Uploaded CPython 3.12Windows x86-64

wryview-0.3.0-cp312-cp312-win32.whl (326.9 kB view details)

Uploaded CPython 3.12Windows x86

wryview-0.3.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.3.0-cp312-cp312-macosx_11_0_arm64.whl (458.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wryview-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl (477.3 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

wryview-0.3.0-cp311-cp311-win_amd64.whl (358.9 kB view details)

Uploaded CPython 3.11Windows x86-64

wryview-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (458.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

wryview-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl (478.2 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

wryview-0.3.0-cp310-cp310-win_amd64.whl (359.2 kB view details)

Uploaded CPython 3.10Windows x86-64

wryview-0.3.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.3.0.tar.gz.

File metadata

  • Download URL: wryview-0.3.0.tar.gz
  • Upload date:
  • Size: 39.7 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.0.tar.gz
Algorithm Hash digest
SHA256 af617fa2d1c7a0015ec4af1e527477d3430065ef316970ca579e26d469b2e4a3
MD5 03384da1be82d0ce6c01b50ad1c4115f
BLAKE2b-256 52e4ad2842110b94ed07910b9662de88e6feddb0948860857a13fa298da90d52

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 358.0 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.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 8dfc99f31df71ef15fad87bc9d9ad2704b799cea9b40e5d610ea2a576a1d8195
MD5 81381eccdb68c7b83ea6f80e08b2693a
BLAKE2b-256 1e768357e26c1c4229ed221a59a3308012b5f14aeef5ee3c566a4d04fa94c5ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2498cf3eb7e3b409cab10d3844e11d3a4b008ddd814f2c1bc4bef2481fc92132
MD5 030a0df884917bfcd6ed24db336cb85b
BLAKE2b-256 757ef5f21bb59eb35f47b55261b7be0adbd05b550106ff4c3b152ebc1b68af36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e5553460c6afe1b5637c16592b2e33bdeb803298f772b37657c43b137b70f047
MD5 c6c950eb6d5b862a01759b166fcc748d
BLAKE2b-256 c5704f8131679496f45e86cad099f207c82fd3ad67d0f8b1fee9678f5df4090d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 358.2 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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 748677614cf43100d1b65a8674f82393a92dc352f9b40b03eb98ade95745f262
MD5 f54d1b66aa61e0923680472b3381b9cd
BLAKE2b-256 e31a01e84c82551ec5cff3c27f3b8cd4b690a1828a6e6c88d94237b5eba84182

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd5497616438566861a4a60c6b520eb6a0ce2b2f7d3f536bcd1a4df8c86f59a7
MD5 931f56d7012bc1260c20dddac63ccbf7
BLAKE2b-256 35f33ec780f48ee6aaf854aa37734ee9e82d6fc5dd24c66778fb2b0172a58265

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 96a859045a1eedfc5bf0eb529195807f1d2e966170cde80eb6a85faa4ecb2cf3
MD5 9db4db1063597b4c2029f39092fc4309
BLAKE2b-256 bbd0b0b44368f11e56e6e373850f07fb611211c64c8a72e097256bcffd9f3def

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 357.4 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 245c65c5626129b7a6cf5886383cc3929b7d0ecd84b9ae0d23bffa49252afad9
MD5 f3b1b336c7f84756bf189db47ba6db34
BLAKE2b-256 b418dd0784d409e7b2c22140cd51cd2ceda4260836816c906cfe00162ba43b6b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 326.9 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.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 82bf26b51299b9db2d0783a4cc422763b21c79c451fe71bf34cfe8fecc089fc5
MD5 65e0365a1c99bb918f837a27497848ab
BLAKE2b-256 c421b6229848c70cf51a3e5f2e910914884053b994ac5fac740254095f2abba7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 31a670e76e6a30c155aa5d1dc50632959fa7388b01ad8a81fc324bdff0636949
MD5 00696c47a83a5dac22cd220946b2d80b
BLAKE2b-256 7deedae8c13fb68673bbf235473229d2ccf5294a929558e77eb302f428c3718f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be65af10e58ca3c287f690509c93bd77e1c2c307584eb5f41bc68eb334ba2576
MD5 3243d9187e375b1c8d19f6dffd8c8a67
BLAKE2b-256 23679c0b93d40ec04f8971492b11e8e91296d97e89ec14828e669de9a0c503c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 42f675dd3d2fafd59f06d783d75c034c4619eea6cfb8541064affff169ea2ef4
MD5 236515c6f14866a1491531c4bf32ddd2
BLAKE2b-256 2464fbb72fd09b3285881e793f3fb16727c090111274f6876c981b959bc51132

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 358.9 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 454e12b8fb8c7aa7358f0e582b90050c5600beb2825c592e45bda06ccbf6ab03
MD5 eca2522acb8051dd8b4bfea70bf63b60
BLAKE2b-256 d2df9664c1f9487232363a1d9621e7c7f1e7cdd82a2227a51b5c1995ba618140

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6cea5cb198176f3e6de725156bd430f4cf92f0ab1ed15b40b9e02c5b3036a286
MD5 e8f6f9858716d76044891e941e2a2f31
BLAKE2b-256 b1d9517701506d4ab331741379f9f6ba662cf06b4797dfab7507bad7f35ec204

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f1b4f2d7b6a77bc1d00b5ff81e6d882460ebe735034e18774759003a6116d5ac
MD5 003042d2ff558dc47c93e15069bd094b
BLAKE2b-256 e62e1eaa9a7070af370a7ff540c1e084e92414e5efb1a00a2e55f94963a6890f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 359.2 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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0e476fa5a01262b1ad3c45eb58c71e4a18b98f346ea98113693fc25871ffd3ce
MD5 970801e53fa6ea6d99cc669808c091e8
BLAKE2b-256 7aedb811f307fbbd85717881221a9940f0729815986f1263c1ba0a71deb891f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.0-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 82e578c7c3042a96bccf4b1c5d20af1fef123338e83bd1aabf1ab66300509775
MD5 3fb22307953ec97d7c1e576efabe1687
BLAKE2b-256 24331fcf5ed54a381721a9db23f71c5dd8b9144d78f168dd3cb59819934f2f25

See more details on using hashes here.

Provenance

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