Skip to main content

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.

📖 Documentation

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:

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dry_webview-0.4.0-cp314-abi3-win_amd64.whl (548.6 kB view details)

Uploaded CPython 3.14+Windows x86-64

dry_webview-0.4.0-cp314-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.3 MB view details)

Uploaded CPython 3.14+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

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

Hashes for dry_webview-0.4.0-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 962e996df7f389b0d6b4ebeba08f4d65084a7b9be708a4c1a5e811830e31d438
MD5 ff0662913ea773f4e253584cd4bd1e54
BLAKE2b-256 03b67704e2981b36e29adea1b5c7899ea02e543de3aa5e7b8fd5153cf91fed3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dry_webview-0.4.0-cp314-abi3-win_amd64.whl:

Publisher: release.yml on barradasotavio/dry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

File hashes

Hashes for dry_webview-0.4.0-cp314-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 2f6d6015935bf5893ce13d025afbd84e6bd45467b3eb803c96fb82be4f42be04
MD5 3c03ce4d850fa6bca001e56cb37cb859
BLAKE2b-256 543012487a6b08a43ac8844f59cba6235339fce43dd8be5d6189012ad6e783db

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.2

4 files

0.3.1

4 files

0.3.0

4 files

0.2.3

2 files

0.2.2

2 files

0.2.0

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page