Skip to content
Back to search

PyWry

PyWry is a cross-platform app factory, rendering engine and UI toolkit for Python that produces native desktop, web, and notebook experiences from a single API.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/deeleeramone--pywry/badge.svg)](/listings/deeleeramone--pywry)

HTML

<a href="/listings/deeleeramone--pywry"><img src="/api/listings/deeleeramone--pywry/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Python 3.10–3.14, virtual environment recommended.

pip install pywry

Core extras:

| Extra | When to use | |-------|-------------| | `pip install 'pywry[notebook]'` | Jupyter / anywidget integration | | `pip install 'pywry[auth]'` | OAuth2 and keyring-backed auth support | | `pip install 'pywry[freeze]'` | PyInstaller hook for standalone executables | | `pip install 'pywry[mcp]'` | Model Context Protocol server support | | `pip install 'pywry[sqlite]'` | Encrypted SQLite state backend (SQLCipher) | | `pip install 'pywry[all]'` | Everything above |

Chat provider extras:

| Extra | When to use | |-------|-------------| | `pip install 'pywry[openai]'` | `OpenAIProvider` (OpenAI SDK) | | `pip install 'pywry[anthropic]'` | `AnthropicProvider` (Anthropic SDK) | | `pip install 'pywry[magentic]'` | `MagenticProvider` (any magentic-supported LLM) | | `pip install 'pywry[acp]'` | `StdioProvider` (Agent Client Protocol subprocess) | | `pip install 'pywry[deepagent]'` | `DeepagentProvider` (LangChain Deep Agents — includes MCP adapters and ACP) |

The chat UI itself is included in the base package. Provider extras only install the matching third-party SDK.

**Linux only** — install system webview dependencies first:

sudo apt-get install libwebkit2gtk-4.1-dev libgtk-3-dev libglib2.0-dev \
    libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
    libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 \
    libxcb-shape0 libgl1 libegl1

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 206 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <picture>
  3. <source media="(prefers-color-scheme: dark)" srcset="pywry/pywry/frontend/assets/PyWry-dark.svg">
  4. <img src="pywry/pywry/frontend/assets/PyWry-light.svg" alt="PyWry" width="640">
  5. </picture>
  6. </div>
  7. PyWry is a cross-platform rendering engine and desktop UI toolkit for Python. One API, three output targets:
  8. - **Native window** — OS webview via [PyTauri](https://pypi.org/project/pytauri/). Not Qt, not Electron. Use unrestricted HTML/CSS/JS.
  9. - **Jupyter widget** — anywidget + FastAPI + WebSocket, works in JupyterLab, VS Code, and Colab.
  10. - **Browser tab** — FastAPI server with Redis state backend for horizontal scaling.
  11. **Build Once, Render Anywhere:** Prototype interactive data apps in a Jupyter Notebook, easily deploy them as web apps, and seamlessly compile them into secure, lightweight standalone desktop executables via `pywry[freeze]`.
  12. <div align="center">
  13. ![PyWry — live TradingView chart driving a streaming chat widget](pywry_tv_chat_screencap_lg.gif)
  14. </div>
  15. ## Installation
  16. Python 3.10–3.14, virtual environment recommended.
  17. ```bash
  18. pip install pywry
  19. ```
  20. Core extras:
  21. | Extra | When to use |
  22. |-------|-------------|
  23. | `pip install 'pywry[notebook]'` | Jupyter / anywidget integration |
  24. | `pip install 'pywry[auth]'` | OAuth2 and keyring-backed auth support |
  25. | `pip install 'pywry[freeze]'` | PyInstaller hook for standalone executables |
  26. | `pip install 'pywry[mcp]'` | Model Context Protocol server support |
  27. | `pip install 'pywry[sqlite]'` | Encrypted SQLite state backend (SQLCipher) |
  28. | `pip install 'pywry[all]'` | Everything above |
  29. Chat provider extras:
  30. | Extra | When to use |
  31. |-------|-------------|
  32. | `pip install 'pywry[openai]'` | `OpenAIProvider` (OpenAI SDK) |
  33. | `pip install 'pywry[anthropic]'` | `AnthropicProvider` (Anthropic SDK) |
  34. | `pip install 'pywry[magentic]'` | `MagenticProvider` (any magentic-supported LLM) |
  35. | `pip install 'pywry[acp]'` | `StdioProvider` (Agent Client Protocol subprocess) |
  36. | `pip install 'pywry[deepagent]'` | `DeepagentProvider` (LangChain Deep Agents — includes MCP adapters and ACP) |
  37. The chat UI itself is included in the base package. Provider extras only install the matching third-party SDK.
  38. **Linux only** — install system webview dependencies first:
  39. ```bash
  40. sudo apt-get install libwebkit2gtk-4.1-dev libgtk-3-dev libglib2.0-dev \
  41. libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
  42. libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 \
  43. libxcb-shape0 libgl1 libegl1
  44. ```
  45. ## Quick Start
  46. ```python
  47. from pywry import PyWry
  48. app = PyWry()
  49. app.show("Hello World!")
  50. app.block()
  51. ```
  52. ### Toolbar + callbacks
  53. ```python
  54. from pywry import PyWry, Toolbar, Button
  55. app = PyWry()
  56. def on_click(data, event_type, label):
  57. app.emit("pywry:set-content", {"selector": "h1", "text": "Clicked!"}, label)
  58. app.show(
  59. "<h1>Hello</h1>",
  60. toolbars=[Toolbar(position="top", items=[Button(label="Click me", event="app:click")])],
  61. callbacks={"app:click": on_click},
  62. )
  63. app.block()
  64. ```
  65. ### Pandas DataFrame → AgGrid
  66. ```python
  67. from pywry import PyWry
  68. import pandas as pd
  69. app = PyWry()
  70. df = pd.DataFrame({"name": ["Alice", "Bob", "Carol"], "age": [30, 25, 35]})
  71. def on_select(data, event_type, label):
  72. names = ", ".join(row["name"] for row in data["rows"])
  73. app.emit("pywry:alert", {"message": f"Selected: {names}"}, label)
  74. app.show_dataframe(df, callbacks={"grid:row-selected": on_select})
  75. app.block()
  76. ```
  77. ### Plotly chart
  78. ```python
  79. from pywry import PyWry
  80. import plotly.express as px
  81. app = PyWry(theme="light")
  82. fig = px.scatter(px.data.iris(), x="sepal_width", y="sepal_length", color="species")
  83. app.show_plotly(fig)
  84. app.block()
  85. ```
  86. ## Features
  87. - **Toolbar components** — `Button`, `Select`, `MultiSelect`, `TextInput`, `SecretInput`, `SliderInput`, `RangeInput`, `Toggle`, `Checkbox`, `RadioGroup`, `TabGroup`, `Marquee`, `Modal`, and more. All Pydantic models; position them around the content edges or inside the chart area.
  88. - **Two-way events** — `app.emit()` and `app.on()` bridge Python and JavaScript in both directions. Pre-wired Plotly and AgGrid events included.
  89. - **Chat** — streaming chat widget with threads, slash commands, artifacts, and pluggable providers: `OpenAIProvider`, `AnthropicProvider`, `MagenticProvider`, `CallbackProvider`, `StdioProvider` (ACP subprocess), and `DeepagentProvider` (LangChain Deep Agents).
  90. - **TradingView charts** — extended Lightweight Charts integration with a full drawing surface (trendlines, fib tools, text annotations, price notes, brushes), pluggable datafeed API, UDF adapter for external quote servers, streaming bar updates, compare overlays, compare-derivative indicators (Spread / Ratio / Sum / Product / Correlation), savable layouts, and a themeable settings panel.
  91. - **Theming** — light / dark / system modes, themeable via `--pywry-*` CSS variables, hot reload during development.
  92. - **Security** — token auth, CSP headers, `SecuritySettings.strict()` / `.permissive()` / `.localhost()` presets. `SecretInput` stores values server-side, never in HTML.
  93. - **State backends** — in-memory (default), Redis (multi-worker), or SQLite with SQLCipher encryption at rest.
  94. - **Standalone executables** — PyInstaller hook ships with `pywry[freeze]`. No `.spec` edits or `--hidden-import` flags required.
  95. - **MCP server** — drive widgets, charts, and dashboards from any Model Context Protocol client (Claude Desktop, Claude Code, Cursor, etc.).
  96. ## MCP Server
  97. ```bash
  98. pip install 'pywry[mcp]'
  99. pywry mcp --transport stdio
  100. ```
  101. Widget-creating tools — `create_widget`, `show_plotly`, `show_dataframe`, `show_tvchart`, `create_chat_widget` — return an **`AppArtifact`**: a self-contained HTML snapshot delivered as an MCP `EmbeddedResource` with `mimeType: text/html` and URI `pywry-app://<widget_id>/<revision>`. Clients that render HTML resources (Claude Desktop's artifact pane, mcp-ui clients, PyWry's own chat widget) show the app inline.
  102. Each render bumps a per-widget revision. The latest revision keeps a live WebSocket bridge to Python; older revisions freeze at their last known state. Call `get_widget_app(widget_id)` to re-snapshot after a mutation.
  103. See the [MCP docs](https://deeleeramone.github.io/PyWry/mcp/) for tool reference and client setup.
  104. ## Claude Code Plugin
  105. Installable under [`claude/plugins/pywry/`](claude/plugins/pywry/) as one `/plugin install` unit. Ships:
  106. - **MCP server** — same 66 tools as above, auto-connected
  107. - **`pywry-orientation` skill** — teaches the agent when to reach for PyWry tools
  108. - **Slash commands** — `/pywry:doctor`, `/pywry:scaffold`, `/pywry:examples`
  109. - **`pywry-builder` subagent** — for multi-step widget construction
  110. - **Post-edit hook** — runs `ruff format` on touched `.py` files
  111. **Install:**
  112. ```
  113. /plugin marketplace add deeleeramone/PyWry --path claude/.claude-plugin/marketplace.json
  114. /plugin install pywry@pywry
  115. ```
  116. **Prerequisite:** `pip install 'pywry[dev]'` (or `pywry[all]`). Then `/pywry:doctor` to verify.
  117. **PyPI-bundled install** (skips the GitHub round-trip once pywry is already installed):
  118. ```bash
  119. pywry plugin-path # prints the bundled plugin root
  120. ```
  121. ```
  122. /plugin marketplace add $(pywry plugin-path)
  123. /plugin install pywry@pywry
  124. ```
  125. See [claude/README.md](claude/README.md) for the full install-path matrix, mono-repo layout, and versioning policy.
  126. ## Standalone Executables
  127. ```bash
  128. pip install 'pywry[freeze]'
  129. pyinstaller --windowed --name MyApp my_app.py
  130. ```
  131. The output in `dist/MyApp/` is fully self-contained. Target machines need no Python installation — only the OS webview (WebView2 on Windows 10 1803+, WKWebView on macOS, libwebkit2gtk on Linux).
  132. ## Documentation
  133. **[deeleeramone.github.io/PyWry](https://deeleeramone.github.io/PyWry/)**
  134. - [Getting Started](https://deeleeramone.github.io/PyWry/getting-started/) — installation, quick start, rendering paths
  135. - [Concepts](https://deeleeramone.github.io/PyWry/getting-started/) — events, configuration, state, hot reload, RBAC
  136. - [Components](https://deeleeramone.github.io/PyWry/components/) — live previews for all toolbar components
  137. - [API Reference](https://deeleeramone.github.io/PyWry/reference/) — auto-generated docs for every class and function
  138. - [MCP Server](https://deeleeramone.github.io/PyWry/mcp/) — AI agent integration
  139. ## CI and Release Policy
  140. - Protected branches: `main` and `develop`.
  141. - Required PR checks: `CI Required` and `Docs Required`.
  142. - Docs deployment: GitHub Pages redeploys only on post-merge pushes to `main`.
  143. - SBOM policy: `sbom.xml` and `sbom.json` are produced during release workflows and bundled with release artifacts, not tracked at repository root.
  144. ## License
  145. Apache 2.0 — see [LICENSE](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.