A light, cross-platform library for building web-based desktop apps with Python.
You can install justbe-webview using either uv
(recommended) or pip
:
# Using uv (recommended)
uv pip install justbe-webview
# Using pip
pip install justbe-webview
import asyncio
from justbe_webview import (
WebView,
Options,
ContentHtml,
Notification,
)
async def main():
config = Options(
title="Simple",
load=ContentHtml(html="<h1>Hello, World!</h1>"),
)
async with WebView(config) as webview:
async def handle_start(event: Notification):
await webview.eval("console.log('This is printed from eval!')")
webview.on("started", handle_start)
if __name__ == "__main__":
asyncio.run(main())
You can find more examples in the examples directory, including:
- Loading URLs
- Loading HTML content
- Window size management
- IPC (Inter-Process Communication)
On first run, the client will:
- Check for a cached binary in the user's cache directory
- If not found, download the appropriate binary for the current platform
- Cache the binary for future use
The exact cache location depends on your operating system:
- Linux:
~/.cache/justbe-webview/
- macOS:
~/Library/Caches/justbe-webview/
- Windows:
%LOCALAPPDATA%\justbe-webview\Cache\
You can specify a custom binary path using the WEBVIEW_BIN
environment variable:
export WEBVIEW_BIN=/path/to/webview/binary
python your_app.py
When set, this will bypass the default binary resolution process.