Skip to main content

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,
    WebViewOptions,
    WebViewContentHtml,
    WebViewNotification,
)

async def main():
    config = WebViewOptions(
        title="Simple",
        load=WebViewContentHtml(html="<h1>Hello, World!</h1>"),
    )

    async with WebView(config) as webview:
        async def handle_start(event: WebViewNotification):
            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:

  1. Check for a cached binary in the user's cache directory
  2. If not found, download the appropriate binary for the current platform
  3. 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

justbe_webview-0.0.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

justbe_webview-0.0.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file justbe_webview-0.0.1.tar.gz.

File metadata

  • Download URL: justbe_webview-0.0.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for justbe_webview-0.0.1.tar.gz
Algorithm Hash digest
SHA256 89504656bc1034f5bd4e9bc59205b9e0561a1f1f8f2c6567aab95f14e737b901
MD5 f3d3b641b6e89b5e59e784637132f438
BLAKE2b-256 a0768f990c8721872ab1f326453ef48930566bd9a965b4f6827ff31d0836db17

See more details on using hashes here.

Provenance

The following attestation bundles were made for justbe_webview-0.0.1.tar.gz:

Publisher: publish-python.yml on zephraph/webview

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

File details

Details for the file justbe_webview-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: justbe_webview-0.0.1-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.8

File hashes

Hashes for justbe_webview-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4544242c100de06686312f208482446bb1ccf9feb9cbf1a4abd036e8175fd350
MD5 f1e01ee4c29b47718e2921ba6a32147a
BLAKE2b-256 91bb206c3abeedf98b5ae2e70cb6b463396354f43cda76975385ece3d9fe390f

See more details on using hashes here.

Provenance

The following attestation bundles were made for justbe_webview-0.0.1-py3-none-any.whl:

Publisher: publish-python.yml on zephraph/webview

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