htag
Python3 GUI toolkit for building 'beautiful' applications for mobile, web, and desktop from a single codebase
What it is and what it does
htag is a reactive Python GUI framework that lets you write web, desktop, and mobile applications using a single codebase. It provides HTML-like components (Tag.div, Tag.button, etc.) with a Python-native API, state management via reactive State objects, and automatic UI synchronization. The framework handles communication via WebSocket with graceful fallbacks to HTTP SSE and pure HTTP, making it suitable for environments with restrictive network policies.
Applications are built as component trees using declarative syntax with context managers, scoped CSS styles, and event handling. It integrates with starlette/FastAPI for web deployment, runs as a ChromeApp for desktop, and supports PyScript for SPA HTML pages. The framework emphasizes developer experience with hot-reload, better error handling, and minimal boilerplate compared to its v1 predecessor.
Use it for:
- Build a web dashboard that runs on starlette/FastAPI with real-time updates via WebSocket, falling back to HTTP polling in restricted networks.
- Create a cross-platform desktop application using ChromeApp that works on Linux, Windows, and macOS from the same Python codebase.
- Develop a single-page application (SPA) using PyScript that runs entirely in the browser without a Python backend.
- Build a mobile-first web app with reactive state management and scoped component styles for responsive design.
- Prototype interactive data visualization or admin tools quickly with minimal boilerplate and automatic UI reactivity.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
htag is a Python GUI toolkit for building web, desktop, and mobile applications from a single codebase using reactive components and HTML-like syntax.
Yes, if you want to build web or desktop GUIs in Python with a modern reactive framework and cross-platform support. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe choice. Verify that the fallback communication modes and Android support meet your specific deployment requirements before committing to production use.
Install
htag on PyPI
pip
pip install htaguv
uv add htagpoetry
poetry add htagInstalling htag
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release (43 days old) and steady repository activity. Requires Python 3.10 or later and depends on starlette, uvicorn, and websockets for runtime.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
pip install -U htag
from htag import Tag
class App(Tag.App):
def render(self):
return Tag.div("Hello, htag")
from htag.runners import ChromeApp
ChromeApp(App).run()
Requires Python 3.10 or later. Desktop runners (ChromeApp) need a browser environment; web deployment requires starlette or FastAPI.
Verify before relying
- Whether the framework's hot-reload and fallback communication modes (WebSocket → HTTP SSE → pure HTTP) work reliably in production environments with strict network policies.
- Performance characteristics and scalability limits for applications with many concurrent users or complex component trees.
- Maturity and stability of Android app building support, given the description notes it 'needs to improve'.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — starlette, uvicorn, websockets |
| Maintenance | actively maintained — 43 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 134,706/month — #11,465 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: htag-2.0.28-py3-none-any.whl
Tags
More User Interfaces packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
humanfriendlyFormats and parses numbers, file sizes,…
permissive · top 1,000 on PyPI
coloredlogsAdds colored output to Python's standard…
permissive · top 1,000 on PyPI
rich-argparseFormats argparse and optparse help output with…
permissive · top 1,000 on PyPI
progressbar2progressbar2 renders text-based progress bars…
permissive · top 5,000 on PyPI
inquirerpyInquirerPy provides interactive command-line…
permissive · top 5,000 on PyPI
prefab-uiPrefab is a Python UI framework for building…
permissive · top 15,000 on PyPI
htbuilderhtbuilder lets you construct HTML strings using…
permissive · top 15,000 on PyPI
KivyKivy is a Python framework for building…
permissive · top 15,000 on PyPI
solara-uiSolara is a React-style Python framework for…
permissive · top 15,000 on PyPI
fletFlet is a Python framework for building…
permissive · top 15,000 on PyPI
solaraSolara is a React-style Python framework for…
permissive · top 15,000 on PyPI
reflex-components-coreProvides a collection of UI components for…
permissive · top 15,000 on PyPI
flet-desktopFlet Desktop provides a Python-only framework…
permissive · top 15,000 on PyPI
solara-serverSolara-server is a Python web framework that…
permissive · top 15,000 on PyPI
shinyShiny for Python is a web development framework…
permissive · top 15,000 on PyPI