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 QtWebView2, 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)
def my_handler(method, uri, headers, body):
    return (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.

🤝 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.1.0.tar.gz (37.6 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.1.0-cp314-cp314-win_amd64.whl (349.2 kB view details)

Uploaded CPython 3.14Windows x86-64

wryview-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (443.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

wryview-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl (464.4 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

wryview-0.1.0-cp313-cp313-win_amd64.whl (349.3 kB view details)

Uploaded CPython 3.13Windows x86-64

wryview-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (443.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wryview-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl (464.5 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

wryview-0.1.0-cp312-cp312-win_amd64.whl (348.5 kB view details)

Uploaded CPython 3.12Windows x86-64

wryview-0.1.0-cp312-cp312-win32.whl (318.7 kB view details)

Uploaded CPython 3.12Windows x86

wryview-0.1.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.1.0-cp312-cp312-macosx_11_0_arm64.whl (442.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wryview-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl (463.7 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

wryview-0.1.0-cp311-cp311-win_amd64.whl (350.1 kB view details)

Uploaded CPython 3.11Windows x86-64

wryview-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (443.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

wryview-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl (464.8 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

wryview-0.1.0-cp310-cp310-win_amd64.whl (350.6 kB view details)

Uploaded CPython 3.10Windows x86-64

wryview-0.1.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.1.0.tar.gz.

File metadata

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

File hashes

Hashes for wryview-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dabe7bcaa5b5dcfdcba5579274aed32869b85f7485b030f333d1efda51425f73
MD5 254c0df9097a6a8aba0a3f22efc45a16
BLAKE2b-256 40af7fda57000098f48ecda857692be10b4aaef05e1f40e914927f46ef382399

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 349.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.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 208af15338860bea64d31aa6749f8c8babe1ecd5af7f8eabf7861e43966b1063
MD5 81fe2ae2c8e9f5588fa61fecc7ff4752
BLAKE2b-256 329fb3a0aa6bcaf70d9d69080b6f99df7729c6404aeac4368bf2ffe7d30dcf2f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07ee39a8a33e60095126293003817f48199e0fe918c1e9c61db44e2db13f0016
MD5 1b40466d06bb2d6d79b85d2cff710180
BLAKE2b-256 f2ebfbc8afc8344fe03d580dd54ce25d8590848a4ff90d7cd811faedb69abb28

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aa59b65540c0c14ef0434e5654637e2b3a0e8d0f06b39356453d4c16e7a3091e
MD5 4580c6810aeb220061f07a5202c40d6f
BLAKE2b-256 871ebfb5e744903dc9dd9a7e1640e3c72640cb5be3b547d7cc11e2b4a40e05fa

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 349.3 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.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8147db223ed250b5e1b201c91e87ca285c32d3e765679e0413aea2057aad390d
MD5 bd3b5034ffdceed19cb60fa9522e3f23
BLAKE2b-256 94cef9794e737e81127931f48cbea0c50f19f0fe55cabc25b40f85aed19a95aa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 490be36bb94255e2eb953edb68da184bc5bbb93cd5a945d6e4d8387132dacb55
MD5 03916eeff05f13723334b5b72c739622
BLAKE2b-256 fb221f74f84e20c2e1bd91b2ca7cff8922b99a191b1c9c8185350a63b61bfd9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7f8a1bd2121a66a946350c5bc99fc2e936d09651310a4b2c70346f9f6a8acc2c
MD5 28517fc8d75cb3d204011f8b1d428d6d
BLAKE2b-256 f3dff69ecbc6b5b304c9e609451f573aada769e2941326df28779d6ac9d9d112

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 348.5 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.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 75c6c3d1f3582ee434ca6de0ab2721311a6dcb8c343861debcd8924599cfd9e0
MD5 1eca2ede1c1176e219bf8c1641d0dd36
BLAKE2b-256 8e5af45192fa788436666a5a331221e3021b0dbb6d2cd15a17ecc481fad7715c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.1.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 318.7 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.1.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 ec9faf0ee3988bc3d83cc1ab1307e6d5b5aa6350a1848aade71dc6f1bc17434b
MD5 b6beca0bfc0f4515b7e61a641abe9eca
BLAKE2b-256 069db1431856df9517601c35b6dd9112c414a2c8e7be0820778eeb4dc06b9734

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 fc881833515e42988a8536365c380242136b725320e72bca93b37bdcf214d10d
MD5 05c5867d5fc4be393794d2044ecd6c91
BLAKE2b-256 ac5b4e88a0c4f399b14373996e31037b6ffb107b66f823fe131970f75ee47d56

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2fd1205425ddc3ace3767fef819ee274330996d6d4edcc0a02e5aafdca55726
MD5 b9cc1e9b7a4f29febd78e870dc0ee84c
BLAKE2b-256 60f875e4440e52bce246fd19e4512f041a380bc37d2ece105b92afa6f71134d4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c6d0e54b2746f0f1077f2e88703695af5bcf2cd78004dcd72217c2b58db62d13
MD5 0927860b0d9e293fff5981fd703cd32e
BLAKE2b-256 2f63d4562cce157952875e1986639fd58e339c8818f99e6acb340cf511f8a0e6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 350.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.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 324f4374e76bd0f1c360f6dd4d0f6c83c14e284c59cfdcfc64cdbec4b1dc7f78
MD5 1b83006e2407f9dcace908c8efee5509
BLAKE2b-256 bc050b4ebc31b58be49ef7977f3519a362eb0df7ac314f5e2c6dbbe7487bf531

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee6e8ee136a7ca7bac634e9007e8addabe7c0c418dccd9f2696c067140c97960
MD5 9598a54d27df28835c17252e8081fba5
BLAKE2b-256 653dfa834fc09ddd95d51a31c899aee2583b54b846cf7f9b8fd22996d4d2bd60

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d0917fd3a66ef21b1788ca1efcf5d99d0edf6f32c6463b9be032e8b707b8b102
MD5 38e0db7be31f54bb4e47080d77e92383
BLAKE2b-256 c119edad10855090aa826e3792af5e3a16b447516afdb61eaa0ab22452652cc4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wryview-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 350.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.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 28acb1d3befd39ececfb6a91dc1625639b05ce77f4a39dc82acabf24ee0e6268
MD5 be68309693a6302f23df4f6bb5a18243
BLAKE2b-256 e8cdfdf0b5f723b5da9d4849214583d9a04d503f211c6e1e52abf5d66c3adbcc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for wryview-0.1.0-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c944aae3cf3b9913a858ebe87f5065c03754625a7c94618e274fdf31959b4f56
MD5 aa1b3e20fb8c2b4421632fd7023e301b
BLAKE2b-256 32dc5eb71e7d81325849da35e8d45ebc1b7ed0c22bf5324d32561d4b839e00ef

See more details on using hashes here.

Provenance

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