You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pywry/docs/docs/getting-started/why-pywry.md
+15-58Lines changed: 15 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,42 +1,15 @@
1
1
# Why PyWry
2
2
3
-
PyWry is a rendering engine for building lightweight, cross-platform interfaces using web technologies (HTML, CSS, JavaScript) with Python. It is open source, Apache-licensed, and free for both commercial and personal use. In this document, we'll explain why companies and developers choose PyWry.
3
+
PyWry is an open-source rendering engine for building lightweight, cross-platform interfaces using Python. It solves a specific problem: **how to build beautiful, modern data applications in Python without being forced into an opinionated web framework or a heavy native GUI toolkit.**
4
4
5
-
We can split up the benefits of PyWry into two questions: First, why should you use web technologies to build your Python interfaces? Then, why should you choose PyWry as the framework to do so?
5
+
PyWry renders standard HTML, CSS, and JavaScript inside battle-tested OS webviews (WebView2 on Windows, WebKit on macOS/Linux). Your team can use web skills they already have — no proprietary widget toolkit to learn. If it works in a browser, it works in PyWry.
6
6
7
-
## Why choose web technologies
8
-
9
-
Modern applications are powered by web technologies - HTML, CSS, JavaScript, and WebAssembly. They are the dominant way to build user interfaces — both for consumer applications and mission-critical business tools. This is true for apps that run in a browser **and** for desktop applications that aren't accessed from a browser.
10
-
11
-
Most application framework SDKs make you choose between native or web-based. PyWry provides a unified Python API that services both. It runs directly inside any Python IDE, making it fast and easy to develop reusable components and layouts that are Pydantic objects.
12
-
13
-
PyWry is a full-stack rendering solution for Python that allows you to declaratively build interactive elements that automatically wire frontend <-> backend communication. No JavaScript required.
14
-
15
-
### Versatility
16
-
17
-
Web technologies are versatile. Your PyWry interface can include anything a web page can, or any custom HTML/CSS/JS you need. It bundles AgGrid and Plotly in the distributed wheel with pre-wired events and sensible defaults that allow you to render tables and charts with minimal effort - without any CDN delivery or other external libraries.
18
-
19
-
20
-
### Reliability
21
-
22
-
Web rendering engines are among the most battle-tested software in the world. The OS webviews that PyWry uses (WebView2 on Windows, WebKit on macOS/Linux) ship with billions of devices and are maintained by Microsoft and Apple respectively.
23
-
24
-
### Interoperability
25
-
26
-
PyWry interfaces are built with standard web APIs. That means you can use any JavaScript library, any CSS framework, and any HTML pattern. If it works in a browser, it works in PyWry.
27
-
28
-
### Ubiquity
29
-
30
-
Web developers are everywhere. If your team needs to customize the frontend, they can use skills they already have. No proprietary widget toolkit to learn.
31
-
32
-
33
-
## Why choose PyWry
34
-
35
-
There are many ways to render web content from Python — Electron-based apps, Dash, Streamlit, NiceGUI, Gradio, Flet, Jupyter widgets, or plain FastAPI servers. So why should you choose PyWry?
7
+
There are many ways to render web content from Python — Electron, Dash, Streamlit, NiceGUI, Gradio, Flet, or plain FastAPI. So why choose PyWry?
36
8
37
9
### The "Goldilocks" Framework
38
10
39
11
Python developers often find themselves choosing between uncomfortable extremes:
12
+
40
13
-**Native GUI Toolkits (PyQt/Tkinter)**: Steep learning curves, custom styling systems, and they don't look modern without massive effort.
41
14
-**Web-to-Desktop (Electron)**: Forces Python developers into the JavaScript/Node.js ecosystem and ships with hundreds of megabytes of Chromium bloat.
42
15
-**Data Dashboards (Streamlit/Gradio)**: Excellent for rapid deployment in a browser, but highly opinionated, difficult to deeply customize, and hard to package as a true desktop executable.
@@ -49,59 +22,43 @@ PyWry's most potent feature is its **"Build Once, Render Anywhere"** pipeline. M
49
22
50
23
You can instantly render a Plotly chart or AgGrid table directly inside a **Jupyter Notebook** cell. When you're ready to share your work, you use the exact same code to deploy a browser-based FastAPI application. When you want to hand an internal tool to a business user, you use `pywry[freeze]` to compile that *same code* into a standalone `.exe` or `.app`—dropping the notebook or server entirely.
51
24
52
-
### Unrestricted Web Technologies
53
-
54
-
Unlike frameworks like Flet (which draws its own UI using the Flutter canvas), PyWry uses standard HTML, CSS, and JS rendered inside a local OS webview. This means you aren't restricted to a custom widget ecosystem. If you want to use Tailwind CSS, arbitrary JS libraries, or your company's internal React design system, PyWry acts as an invisible bridge.
55
-
56
25
### Lightweight Native Windows
57
26
58
-
PyWry uses the **OS-native webview** (WebView2, WebKit) instead of bundling a full browser engine. A PyWry app adds a few megabytes of overhead. An Electron app ships 150 MB+ of Chromium, and can't be used as a web application. Dash, Streamlit, and Panel require a running web server; they don't create native OS windows.
27
+
PyWry uses the **OS-native webview** (WebView2, WebKit) via [PyTauri](https://github.com/pytauri/pytauri)instead of bundling a full browser engine like Electron. This results in apps that add only a few megabytes of overheadand open in under a second. There's no server to spin up and no browser to launch.
59
28
60
29
### One API, three targets
61
30
62
-
Write your interface once. PyWry automatically renders it in the right place:
31
+
Write your interface once. PyWry automatically renders it in the right place without changing your code:
63
32
64
33
| Environment | Rendering Path |
65
34
|---|---|
66
35
| Desktop terminal | Native OS window via PyTauri |
67
36
| Jupyter / VS Code / Colab | anywidget or inline IFrame |
You don't change your code. PyWry detects the environment and picks the right backend.
71
39
72
40
### Built for data workflows
73
41
74
-
PyWry isn't a general-purpose web framework. It's built specifically for Python data workflows:
75
-
76
-
-**Plotly charts** with pre-wired event callbacks (click, select, hover, zoom)
77
-
-**AG Grid tables** with automatic DataFrame conversion and grid events
78
-
-**Toolbar system** with 18 Pydantic input components across 7 layout positions
79
-
-**Two-way events** between Python and JavaScript, with no boilerplate
80
-
81
-
The Toolbar system lets you build nested structures that wrap around your main content. You can easily add headers, footers, collapsible sidebars, marquees, and overlays - with no custom HTML or JS.
42
+
PyWry comes with built-in integrations tailored for data workflows:
82
43
83
-
### Fast startup
44
+
-**Plotly charts** with pre-wired event callbacks (click, select, hover, zoom).
45
+
-**AG Grid tables** with automatic DataFrame conversion and grid events.
46
+
-**Toolbar system** with 18 declarative Pydantic input components across 7 layout positions to easily add headers, sidebars, and overlays.
47
+
-**Two-way events** between Python and JavaScript, with no boilerplate.
84
48
85
-
Native windows open in under a second. There's no server to spin up, no browser to launch, no bundle to compile. For notebook widgets, rendering is near-instant through anywidget.
86
49
87
50
### Production-ready
88
51
89
-
PyWry isn't just for prototyping and single-user applications:
52
+
PyWry scales from prototyping to multi-user deployments:
90
53
91
-
-**Deploy Mode** with Redis backend for horizontal scaling and RBAC
92
-
-**OAuth2** authentication system for both native and deploy modes
93
-
-**Token authentication** and CSRF protection out of the box
94
-
-**CSP headers** and security presets for production environments
95
-
-**TOML-based configuration** with layered precedence (defaults → project → user → env vars)
54
+
-**Deploy Mode** with an optional Redis backend for horizontal scaling.
55
+
-**OAuth2** authentication system for both native and deploy modes with enterprise RBAC.
56
+
-**Security built-in**: Token authentication, CSRF protection, and CSP headers out of the box.
96
57
97
58
### Cross-platform
98
59
99
60
PyWry runs on Windows, macOS, and Linux. The same code produces native windows on all three platforms, notebook widgets in any Jupyter environment, and browser-based interfaces anywhere Python runs.
100
61
101
-
### Mature foundation
102
-
103
-
PyWry is built on [Tauri](https://tauri.app/) via [PyTauri](https://github.com/pytauri/pytauri) — a mature Rust framework used by thousands of production applications. The webview layer, event system, and window management are battle-tested Rust code, not Python wrappers around fragile subprocess calls.
0 commit comments