Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

webview-proc

webview-proc is a Python package that simplifies running pywebview windows in a separate thread, enhancing stability and performance for desktop applications by isolating webview operations from the main thread. The WebViewProcess class provides a synchronous API for creating, managing, and communicating with webview windows, supporting operations like opening, closing, resizing, maximizing, toggling fullscreen, setting titles, handling file dialogs, and evaluating JavaScript. Ideal for hybrid applications combining web technologies with native interfaces, webview-proc offers a lightweight and extensible solution for Python developers.

Features

  • Run pywebview windows in a separate thread for crash isolation.
  • Synchronous WebViewProcess class for simple, blocking operations.
  • Comprehensive API for window operations: open, close, resize, maximize, fullscreen, set title, file dialogs, and JavaScript evaluation.
  • Thread-safe communication for reliable control.
  • Cross-platform support (Windows, macOS, Linux) with flexible pywebview GUI backends (e.g., Qt, GTK, Cocoa).
  • Extensible for other webview engines (e.g., QtWebEngine, CEF).

Installation

pip install webview-proc

Basic Usage

from webview_proc import WebViewProcess

# Create a webview process
webview = WebViewProcess(
    url="http://localhost:8000",
    title="My App",
    width=800,
    height=600,
    icon_path="path/to/icon.png",
)

# Start the webview in a separate thread
webview.start()

# Perform window operations
webview.set_title("New Title")
webview.resize(1000, 700)
webview.toggle_fullscreen()

# Open a file dialog
files = webview.pick_file(file_types=["pdf", "png"], multiple=True)

# Close the window
webview.close()

# Wait for the thread to terminate
webview.join()

Why webview-proc?

webview-proc addresses the need for stable and isolated webview management in Python applications. By running pywebview windows in a separate thread, it prevents crashes from affecting the main application. The synchronous WebViewProcess class is ideal for scripts and applications requiring simple, blocking operations, and it integrates seamlessly with web servers (e.g., FastAPI). The package handles platform-specific quirks (e.g., main-thread requirements on macOS), making it suitable for desktop and hybrid web apps.

Contributing

Contributions are welcome! Check out our Contributing Guidelines and Issue Tracker to get started.

License

MIT License

Metadata

Release files for webview-proc 0.1.0rc7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webview-proc 0.1.0rc7
File Size Uploaded
webview_proc-0.1.0rc7.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for webview-proc 0.1.0rc7
File Interpreter ABI Platform
webview_proc-0.1.0rc7-py3-none-any.whl Python 3 none any Details

Total release size: 18.3 kB

Release files / webview_proc-0.1.0rc7.tar.gz

Download URL webview_proc-0.1.0rc7.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bf136f1b5da9c26d586e46fc06a76fa41af65c8f63a51993bc88fed8a7337f55
BLAKE2b-256 checksum
How to use checksums
68fd96b50fb04e9c4ab4bf5863baf955ec89e797bc726c655b48d15170c805de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / webview_proc-0.1.0rc7-py3-none-any.whl

Download URL webview_proc-0.1.0rc7-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05ee7428f7074dc0cbf2b09697cfc35a34b55c95c01d8f28a3fbfe5e8778aa4b
BLAKE2b-256 checksum
How to use checksums
3ba3997510528f30dd27e864649c29227fbaeeffc179be0bd4ab1c8f19f78c21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6
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