pywebview
Build GUI for your Python program with JavaScript, HTML, and CSS
What it is and what it does
pywebview is a lightweight wrapper around native webview components that lets you build desktop GUI applications using HTML, CSS, and JavaScript while keeping the logic in Python. It uses the platform's native rendering engine—WinForms on Windows, Cocoa on macOS, and Qt or GTK on Linux—so you don't bundle a separate browser engine, keeping executable size small. The package includes a built-in HTTP server for serving your UI, two-way communication between Python and JavaScript, DOM support, and native window management (menus, dialogs, window control).
It's designed for developers who want to leverage web technologies for UI but keep their application logic in Python. You write your interface in HTML/CSS/JavaScript and call Python functions from the frontend, or update the DOM from Python. The framework handles the platform-specific details, so the same code runs on Windows, macOS, and Linux with native look and feel.
Use it for:
- Build a cross-platform desktop application with a web-based UI without bundling a heavy GUI toolkit.
- Create a Python tool with an HTML/CSS interface for configuration, monitoring, or data visualization.
- Develop a native-looking desktop app that reuses existing web components or React code.
- Wrap a Python backend service with a lightweight GUI that communicates via Python-JavaScript bridge.
- Prototype or ship a desktop application quickly using familiar web technologies while keeping the executable small.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pywebview wraps native webview components to display HTML/CSS/JavaScript content in desktop GUI windows, with built-in HTTP server, Python-JavaScript communication, and native window controls.
Yes, if you want to build a cross-platform desktop GUI in Python using web technologies without heavy toolkit overhead. The package is actively maintained, has no known vulnerabilities, and uses a permissive BSD license. Install friction is low, though you may need platform-specific system libraries. It's well-suited for developers comfortable with both Python and web technologies.
Install
pywebview on PyPI
pip
pip install pywebviewuv
uv add pywebviewpoetry
poetry add pywebviewInstalling pywebview
Before you install
Low install friction; ships as a pure-Python wheel. Runtime dependencies are platform-specific (pythonnet on Windows, pyobjc frameworks on macOS, QtPy on Linux), so actual installation may require system libraries—check the installation guide for your platform.
License in practice
BSD 3-Clause License permits commercial and private use with minimal restrictions; you may use, modify, and distribute pywebview provided you retain the copyright notice and disclaimer.
Quickstart
pip install pywebview
import pywebview
pywebview.create_window('Hello world', 'https://pywebview.flowrl.com/hello')
pywebview.start()
Platform-specific system libraries may be required (e.g., GTK/Qt development headers on Linux); see installation guide. Requires Python >=3.8.
Verify before relying
- Whether the built-in HTTP server is suitable for production use or intended only for development.
- Performance characteristics and memory footprint compared to other desktop webview frameworks.
- Specific DOM manipulation capabilities and their scope beyond the examples shown.
Package facts
| License | BSD 3-Clause License Copyright (c) 2014-2017, Roman Sirokov All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 12 — pythonnet, pyobjc-core, pyobjc-framework-Cocoa, pyobjc-framework-Quartz, pyobjc-framework-WebKit, pyobjc-framework-security, pyobjc-framework-UniformTypeIdentifiers, QtPy, importlib_resources, proxy_tools, bottle, typing_extensions |
| Maintenance | actively maintained — 121 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,680,813/month — #3,657 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pywebview-6.2.1-py3-none-any.whl
Keywords: gui, webkit, html, web
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
PyQtWebEnginePyQtWebEngine provides Python bindings to embed…
copyleft · top 15,000 on PyPI
telepathtelepath serializes Python objects to…
permissive · top 5,000 on PyPI
pysimpleguiPySimpleGUI wraps tkinter and other GUI…
copyleft · top 15,000 on PyPI
PyQt5PyQt5 provides Python bindings for the Qt v5…
copyleft · top 5,000 on PyPI
xvfbwrapperManages headless X11 virtual displays using…
permissive · top 5,000 on PyPI
PyQt6-WebEnginePyQt6-WebEngine provides Python bindings to…
copyleft · top 15,000 on PyPI
PyGObjectPyGObject provides Python bindings for…
copyleft · top 15,000 on PyPI
wxPythonwxPython provides Python bindings to the…
unclear · top 15,000 on PyPI
niceguiNiceGUI is a Python framework for building…
permissive · top 5,000 on PyPI
streamlit-javascriptExecutes arbitrary JavaScript code from within…
permissive · top 15,000 on PyPI