PyWry: Cross-Platform Rendering Engine in Python

· web coding · Source ↗

TLDR

  • Python library wrapping native OS webviews via PyTauri to build UIs that run in Jupyter, FastAPI, or as compiled desktop apps from one codebase.

Key Takeaways

  • Uses lightweight native OS webviews instead of bundling Chromium, directly targeting the Electron bloat problem for Python desktop apps.
  • Single codebase deploys three ways: Jupyter anywidget, browser via FastAPI WebSockets, or standalone desktop executable via PyTauri.
  • UI is declarative: Pydantic models placed in 7 layout positions cover toolbars, modals, toasts, and inputs.
  • Two-way Python-to-JavaScript event bridge ships with out-of-the-box support for AgGrid, Plotly, and TradingView.
  • Includes OAuth2, Redis RBAC state management, hot reloading, and 60+ CSS variables for theming.

Hacker News Comment Review

  • The “rendering engine” branding is misleading: commenters noted it is more accurately a web-based UI toolkit that deploys to desktop via Tauri, not a graphics/render engine.
  • The slim install hides a 30.8MB vendored binary (ext_mod.cpython-310-darwin.so) pulled from the pytauri project, which is the actual heavy lifter under the hood.

Notable Comments

  • @simonw: Identified the 30.8MB vendored PyTauri binary inside the wheel, sourced from github.com/pytauri/pytauri.
  • @simonw: Posted a uv run --with pywry python one-liner to try it without installing.

Original | Discuss on HN