Name | webview-proc JSON |
Version |
0.1.0rc7
JSON |
| download |
home_page | None |
Summary | A Python package for running pywebview windows in a separate thread, providing a synchronous API for stable and isolated webview management. |
upload_time | 2025-10-20 00:01:42 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License |
keywords |
api
gui
pywebview
subprocess
synchronous
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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
```bash
pip install webview-proc
```
## Basic Usage
```python
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](https://github.com/10x-concepts/webview-proc/blob/main/CONTRIBUTING.md) and [Issue Tracker](https://github.com/10x-concepts/webview-proc/issues) to get started.
## License
MIT License
Raw data
{
"_id": null,
"home_page": null,
"name": "webview-proc",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "api, gui, pywebview, subprocess, synchronous",
"author": null,
"author_email": "Ilya Pevzner <iap@10xconcepts.com>",
"download_url": "https://files.pythonhosted.org/packages/68/fd/96b50fb04e9c4ab4bf5863baf955ec89e797bc726c655b48d15170c805de/webview_proc-0.1.0rc7.tar.gz",
"platform": null,
"description": "# webview-proc\n\n`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.\n\n## Features\n- Run `pywebview` windows in a separate thread for crash isolation.\n- Synchronous `WebViewProcess` class for simple, blocking operations.\n- Comprehensive API for window operations: open, close, resize, maximize, fullscreen, set title, file dialogs, and JavaScript evaluation.\n- Thread-safe communication for reliable control.\n- Cross-platform support (Windows, macOS, Linux) with flexible `pywebview` GUI backends (e.g., Qt, GTK, Cocoa).\n- Extensible for other webview engines (e.g., QtWebEngine, CEF).\n\n## Installation\n```bash\npip install webview-proc\n```\n\n## Basic Usage\n```python\nfrom webview_proc import WebViewProcess\n\n# Create a webview process\nwebview = WebViewProcess(\n url=\"http://localhost:8000\",\n title=\"My App\",\n width=800,\n height=600,\n icon_path=\"path/to/icon.png\",\n)\n\n# Start the webview in a separate thread\nwebview.start()\n\n# Perform window operations\nwebview.set_title(\"New Title\")\nwebview.resize(1000, 700)\nwebview.toggle_fullscreen()\n\n# Open a file dialog\nfiles = webview.pick_file(file_types=[\"pdf\", \"png\"], multiple=True)\n\n# Close the window\nwebview.close()\n\n# Wait for the thread to terminate\nwebview.join()\n```\n\n## Why webview-proc?\n`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.\n\n## Contributing\nContributions are welcome! Check out our [Contributing Guidelines](https://github.com/10x-concepts/webview-proc/blob/main/CONTRIBUTING.md) and [Issue Tracker](https://github.com/10x-concepts/webview-proc/issues) to get started.\n\n## License\nMIT License",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A Python package for running pywebview windows in a separate thread, providing a synchronous API for stable and isolated webview management.",
"version": "0.1.0rc7",
"project_urls": {
"Documentation": "https://github.com/10x-concepts/webview-proc#readme",
"Homepage": "https://github.com/10x-concepts/webview-proc",
"Issues": "https://github.com/10x-concepts/webview-proc/issues",
"Repository": "https://github.com/10x-concepts/webview-proc"
},
"split_keywords": [
"api",
" gui",
" pywebview",
" subprocess",
" synchronous"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "3ba3997510528f30dd27e864649c29227fbaeeffc179be0bd4ab1c8f19f78c21",
"md5": "d33052d1d1192f66f6640adb6b29afbf",
"sha256": "05ee7428f7074dc0cbf2b09697cfc35a34b55c95c01d8f28a3fbfe5e8778aa4b"
},
"downloads": -1,
"filename": "webview_proc-0.1.0rc7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d33052d1d1192f66f6640adb6b29afbf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8523,
"upload_time": "2025-10-20T00:01:41",
"upload_time_iso_8601": "2025-10-20T00:01:41.527921Z",
"url": "https://files.pythonhosted.org/packages/3b/a3/997510528f30dd27e864649c29227fbaeeffc179be0bd4ab1c8f19f78c21/webview_proc-0.1.0rc7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "68fd96b50fb04e9c4ab4bf5863baf955ec89e797bc726c655b48d15170c805de",
"md5": "61e32034e88f66e879bb28712df4e00c",
"sha256": "bf136f1b5da9c26d586e46fc06a76fa41af65c8f63a51993bc88fed8a7337f55"
},
"downloads": -1,
"filename": "webview_proc-0.1.0rc7.tar.gz",
"has_sig": false,
"md5_digest": "61e32034e88f66e879bb28712df4e00c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 9822,
"upload_time": "2025-10-20T00:01:42",
"upload_time_iso_8601": "2025-10-20T00:01:42.361855Z",
"url": "https://files.pythonhosted.org/packages/68/fd/96b50fb04e9c4ab4bf5863baf955ec89e797bc726c655b48d15170c805de/webview_proc-0.1.0rc7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-20 00:01:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "10x-concepts",
"github_project": "webview-proc#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "webview-proc"
}