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.2.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.2-cp314-cp314-win_amd64.whl (360.0 kB view details)

Uploaded CPython 3.14Windows x86-64

wryview-0.3.2-cp314-cp314-macosx_11_0_arm64.whl (534.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

wryview-0.3.2-cp314-cp314-macosx_10_12_x86_64.whl (564.5 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

wryview-0.3.2-cp313-cp313-win_amd64.whl (360.1 kB view details)

Uploaded CPython 3.13Windows x86-64

wryview-0.3.2-cp313-cp313-macosx_11_0_arm64.whl (535.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wryview-0.3.2-cp313-cp313-macosx_10_12_x86_64.whl (564.5 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

wryview-0.3.2-cp312-cp312-win_amd64.whl (359.3 kB view details)

Uploaded CPython 3.12Windows x86-64

wryview-0.3.2-cp312-cp312-win32.whl (328.2 kB view details)

Uploaded CPython 3.12Windows x86

wryview-0.3.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (534.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wryview-0.3.2-cp312-cp312-macosx_10_12_x86_64.whl (563.4 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

wryview-0.3.2-cp311-cp311-win_amd64.whl (360.6 kB view details)

Uploaded CPython 3.11Windows x86-64

wryview-0.3.2-cp311-cp311-macosx_11_0_arm64.whl (535.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

wryview-0.3.2-cp311-cp311-macosx_10_12_x86_64.whl (564.7 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

wryview-0.3.2-cp310-cp310-win_amd64.whl (361.1 kB view details)

Uploaded CPython 3.10Windows x86-64

wryview-0.3.2-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.2.tar.gz.

File metadata

  • Download URL: wryview-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a1bb9cd7be0b4f3f3d3633100ec4cd46cd97bd749eb63564affcf441f546678f
MD5 0a9ef8407e3482527cab0c80b0889e88
BLAKE2b-256 b333387a6aec335adc099f5771e2d87c00ca35e72da03bdf03e253c90db85b5b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 360.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.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7c3c648b32a3a3f3a0268bc136cf15fbfbb9b7cfa95d3d21e7b87052cc043e70
MD5 aba16cd2c6a6eec528164e3b74363aeb
BLAKE2b-256 b3ef049e493860992ca558d0d97b1e67cc810159a233d6c6e1421cce0659c303

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c378a545513af7f5dea14a6c2fbb534944f2ca23ce2a212613adfa26375ca71b
MD5 1e4c54a80b3973c8b5cc98f22456fab9
BLAKE2b-256 073f2165fce240f520529e90b1cf7a3ba87609945409f8145f3be6d99465c03a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 070ddde46385d0e856d8d14c7b210139ff3cb786fa9c7321c54d709e6adca339
MD5 c6256e6ba4956c4893b26b7bb6be0264
BLAKE2b-256 a524e70ed44e66e87fef91366e2e169bd65c0387e7b72d1df163e8244f547024

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 360.1 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9a29e9af385a45a142dc39eea655dd2ee1214eb4a6ffd3a9a6d9199b8469aff0
MD5 dcfe010516e6bf26fc7ebb5cc231c99a
BLAKE2b-256 a2a6917293c7468762d1b9e86eb80e9b069a2131349a03a0902360ed3c72a239

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18784a8e28ef229800cd01569d6de7470f4dfed54fbf788b5559d3a564dd9c78
MD5 d074eff1ac7c269602409911ccb918ee
BLAKE2b-256 f954e79d2a4fdf5874b6959d32f2c440a430a4ce3fb32cc0573b783894f0d403

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 311c9ac5bed8d51db22fe454401e62260f7d00cfb60e3f83f12a7021c2d00198
MD5 331253a7bb5c7a5e54fb42e6a83d7f41
BLAKE2b-256 9e2109cce75ece94cd2a9bfb469021f084b33521057e0b2051c9427e787765da

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 359.3 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 469b99287b44278c8e6dcfee46e90a07cefe47aecf64abc7bec50eb28401d44f
MD5 43f2e0d46bc574d9721753684d01f85e
BLAKE2b-256 92743270fa5289ca4d95b45fb80ab3e5b8985d7e9c71ac713f1bce5d8b9663a0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.2-cp312-cp312-win32.whl
  • Upload date:
  • Size: 328.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.3.2-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 f0c1d5d24a5b6f9648e2ce355f0a2d073af6e482b9687397f09e1a3f192c2647
MD5 4aafcb49c251914a447d1c8a750f4c46
BLAKE2b-256 c9b8b7583d7d0ca282532dc557bfb05e901ca7242f48c9acdaf25fdfa1d193cd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 74ba66bc79c55f54bf23ee66c766064a23dce4c39145119cf4cab695b6225d20
MD5 9e3ee5d32ec0c5b1c35ff46424064f1b
BLAKE2b-256 a41ecbb403fff0c4a75b50b1056b91d83791e8514889f7c0e58b5186d6b5e9bd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5827f741d060cba7f703477d7099b9db1ed31187676f43f06a1e524ea0b38c31
MD5 fba79e8b6ae645b605a032373e2b59cd
BLAKE2b-256 ae020c11ec57bc6b2bb723107ec323ab343c6b4d2869d3a090ded27b02efca93

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d6caacf65aff4be90e1d7e65f266c1c624a7367aba0ce15186e02552483881a0
MD5 02bbe53b98cfbd781f01d08b859a589b
BLAKE2b-256 58f44215c3c062134f6d652b229d266c46b80475ef7151431b0fb8df1be1849a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 360.6 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 95687f816b59bbae710f2ba48c04da6910fbf7a1a2c167a4feb48e26c68abb07
MD5 5bc4aa28db02f6a621a1015efb4c3d40
BLAKE2b-256 d960c35d311fb692cd9f9043ca3973e5eb19d8fd08006651b462a256d34af759

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43ad432598dc24542f90bfe9ec80dd8a609713bcfe3838c717d2ff3487c96771
MD5 62410cfb08b655563f15dd9c1b6d6e65
BLAKE2b-256 9363784febf1470a75935a3e3e11acc9937076d07f8b4e95db0488840263137f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 67dca77acd599a96f15e6d354a9b09722d1f9124bf3ebe3cbdfdd77b45cfd7d6
MD5 345a5a84e476acaa5586510545a90673
BLAKE2b-256 39555e573c96023146b34a0b4ab5bce4330fc358aaa388f6bd9ae01742f45788

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.3.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 361.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.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 953bee2740b9cecae511f857036d987432b716b8d984670ea06807c1851707ef
MD5 c49ec3e08313d08de4daed1a6e60e15b
BLAKE2b-256 1fc8fc351c006b2de97fbdcc813c529fa0efa00750d85a6d2d76537a815f392a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.3.2-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 af90c1db22b752efd9a1ff71a7b1554988a97698e237d9f7cbdd2b0ffa8965e3
MD5 aa640d4b668be958de800446ef57bf07
BLAKE2b-256 f8d90fa35810999631f3819f726692497eadc20718b9e7a3a553fddb67c8d8b6

See more details on using hashes here.

Provenance

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