A simple webview client
Project description
justbe-webview
A light, cross-platform library for building web-based desktop apps with Python.
Installation
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
Example
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)
Binary Management
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\
Using a Custom Binary
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.
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
Built Distribution
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 justbe_webview-0.0.2.tar.gz.
File metadata
- Download URL: justbe_webview-0.0.2.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7ed25a00aa85f4ad326321d9bf49f94e8be9384dfcab1dc5f525b025e02d7e3
|
|
| MD5 |
f0ede49ca77336a0fa349ee27c9fe0ac
|
|
| BLAKE2b-256 |
a93317691aad3d0749adceb266c54346d39fc3ed121a56c2a92bcaab1bb50904
|
Provenance
The following attestation bundles were made for justbe_webview-0.0.2.tar.gz:
Publisher:
publish-python.yml on zephraph/webview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
justbe_webview-0.0.2.tar.gz -
Subject digest:
b7ed25a00aa85f4ad326321d9bf49f94e8be9384dfcab1dc5f525b025e02d7e3 - Sigstore transparency entry: 173628411
- Sigstore integration time:
-
Permalink:
zephraph/webview@49eda3720f561d9dafcbfc0efad4a30b007dd1c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephraph
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@49eda3720f561d9dafcbfc0efad4a30b007dd1c3 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file justbe_webview-0.0.2-py3-none-any.whl.
File metadata
- Download URL: justbe_webview-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
958554710a90e4eb9284e6b789b1c90b035247e2f758f24676f018227e53f38f
|
|
| MD5 |
6f688909ec4eb3d16dcde0f27d7b72da
|
|
| BLAKE2b-256 |
6302ebfe304c42bfee3745ececb0a942410e1cd676ed201ed17c08aff61f842b
|
Provenance
The following attestation bundles were made for justbe_webview-0.0.2-py3-none-any.whl:
Publisher:
publish-python.yml on zephraph/webview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
justbe_webview-0.0.2-py3-none-any.whl -
Subject digest:
958554710a90e4eb9284e6b789b1c90b035247e2f758f24676f018227e53f38f - Sigstore transparency entry: 173628413
- Sigstore integration time:
-
Permalink:
zephraph/webview@49eda3720f561d9dafcbfc0efad4a30b007dd1c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephraph
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@49eda3720f561d9dafcbfc0efad4a30b007dd1c3 -
Trigger Event:
workflow_run
-
Statement type: