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,
    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:

  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.3.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.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for justbe_webview-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9ebe294cc5aeaafefcda941fff643fc3e646a07fadfc34b155300522179af327
MD5 6c2d5517ea802707f5b1230b775c8399
BLAKE2b-256 2c0edfc8c2250d29f60b4fa461d08f12df7e6f25f19304c0d05ec0ab0741f865

See more details on using hashes here.

Provenance

The following attestation bundles were made for justbe_webview-0.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: justbe_webview-0.0.3-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

Hashes for justbe_webview-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2e71990dba657919af24c09ea6f7dd3093f54b50b6458c4212a300d017584f75
MD5 528f2ee99b12ff9ea2aa14475a5eed71
BLAKE2b-256 9749137fda72c10746b373780163af3666e7e9d3189309f418caae950edf5be9

See more details on using hashes here.

Provenance

The following attestation bundles were made for justbe_webview-0.0.3-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