Dry
One native window rendering a web frontend, and a Bridge to Python.
Dry is a small, dependency-free library for building a desktop UI out of HTML, CSS and JavaScript, driven by Python. It is written in Rust on top of Wry, and renders with the web engine the operating system already ships — WebView2 on Windows, WKWebView on macOS.
Installation
pip install dry-webview
Requires CPython 3.14 or newer, on Windows or macOS.
Getting started
from dry import Webview
HTML = """
<button onclick="greet()">Greet</button>
<p id="out"></p>
<script>
async function greet() {
out.textContent = await window.dry.api.hello('World');
}
</script>
"""
def hello(name: str) -> str:
return f'Hello, {name}!'
wv = Webview(
app_id='com.example.hello',
title='Hello',
html=HTML,
api={'hello': hello},
)
wv.run()
wv.run() opens the window and hands it the process: closing the window exits
the interpreter, so nothing written after it runs.
Render an HTML string, a URL, or a directory of compiled assets. Call Python
from JavaScript and get a Promise back. Emit Events in either direction.
Drop the native titlebar and draw your own. Move, resize, hide and read the
open window from Python. More examples are in
examples/.
Documentation
Everything else lives on the documentation site:
- Content modes — an HTML string, a URL, or a served directory
- The Bridge — Calls, Events, and the contract on what may cross
- Custom titlebars and window Events
- Runtime window control — moving, resizing, hiding and reading the open window from Python
- Errors and logging
- Reference
- Architecture decisions
Upgrading from 0.3.x
0.4.0 is a breaking release. The JavaScript surface moved under
window.dry, content modes are explicit, sizes are logical pixels, the Bridge
contract is now strictly the JSON data model, application data moved to an App
id, and the Python floor is 3.14. Each break, and what to do about it, is in
the migration
guide. The
changelog has
the full list.
Platform support
| Platform | Status |
|---|---|
| Windows (x86-64) | Supported. Built and tested on every commit |
| macOS (universal2) | Supported. Built and tested on every commit |
| Linux | Not supported |
| Python | Status |
|---|---|
| CPython 3.14 and newer | Supported, via a single abi3 wheel per platform |
| CPython 3.13 and older | Not supported |
| Free-threaded builds | Not supported until abi3t |
Contributing
Issues and specs live as GitHub issues. Building from source needs a Rust toolchain and maturin:
uv run maturin develop --uv
uv run python -m unittest discover -s tests
cargo test
The documentation site is Markdown under docs/guide, built with
mdBook: mdbook serve docs previews it.
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dry_webview-0.4.0-cp314-abi3-win_amd64.whl.
File metadata
- Download URL: dry_webview-0.4.0-cp314-abi3-win_amd64.whl
- Upload date:
- Size: 548.6 kB
- Tags: CPython 3.14+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
962e996df7f389b0d6b4ebeba08f4d65084a7b9be708a4c1a5e811830e31d438
|
|
| MD5 |
ff0662913ea773f4e253584cd4bd1e54
|
|
| BLAKE2b-256 |
03b67704e2981b36e29adea1b5c7899ea02e543de3aa5e7b8fd5153cf91fed3c
|
Provenance
The following attestation bundles were made for dry_webview-0.4.0-cp314-abi3-win_amd64.whl:
Publisher:
release.yml on barradasotavio/dry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dry_webview-0.4.0-cp314-abi3-win_amd64.whl -
Subject digest:
962e996df7f389b0d6b4ebeba08f4d65084a7b9be708a4c1a5e811830e31d438 - Sigstore transparency entry: 2377418635
- Sigstore integration time:
-
Permalink:
barradasotavio/dry@f4b5df57e6dc98dab85b2752348c0561253b621b -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/barradasotavio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4b5df57e6dc98dab85b2752348c0561253b621b -
Trigger Event:
push
-
Statement type:
File details
Details for the file dry_webview-0.4.0-cp314-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: dry_webview-0.4.0-cp314-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.14+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f6d6015935bf5893ce13d025afbd84e6bd45467b3eb803c96fb82be4f42be04
|
|
| MD5 |
3c03ce4d850fa6bca001e56cb37cb859
|
|
| BLAKE2b-256 |
543012487a6b08a43ac8844f59cba6235339fce43dd8be5d6189012ad6e783db
|
Provenance
The following attestation bundles were made for dry_webview-0.4.0-cp314-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:
Publisher:
release.yml on barradasotavio/dry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dry_webview-0.4.0-cp314-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
2f6d6015935bf5893ce13d025afbd84e6bd45467b3eb803c96fb82be4f42be04 - Sigstore transparency entry: 2377418613
- Sigstore integration time:
-
Permalink:
barradasotavio/dry@f4b5df57e6dc98dab85b2752348c0561253b621b -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/barradasotavio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4b5df57e6dc98dab85b2752348c0561253b621b -
Trigger Event:
push
-
Statement type: