Build Frontend in Python
Python-native reactive components with routing and SSR/SSG — all in Python, running in the browser via PyScript.
Reactive by default
Signals and computed values keep the DOM in sync automatically — no manual refresh calls.
Components & Router
Function-style components with props, slots, and scoped CSS, plus client-side routing in history or hash mode.
CLI, SSR & SSG
Scaffold projects, run a dev server with live reload, and pre-render pages with server-side rendering or static site generation.
PyScript runtime
Your Python runs in the browser via PyScript — reuse the ecosystem you know, including numpy and friends.
Coming from Jinja2 + FastAPI?
Migrate server-rendered FastAPI pages incrementally with ASGI host mounting and live before/after examples. Read the Migration Guide →
Accessible UI & Themes
Headless and token-themed dialogs, forms, and disclosures with built-in light and dark modes. Explore UI Primitives →
Try it in a minute
Scaffold a project with the recommended uv setup: Then define your first component:Full setup → Installation
Prefer Poetry? See theInstallation guide for the Poetry path.
mkdir webcompy-project && cd webcompy-project
uv init
uv add "webcompy @ git+https://github.com/kniwase/WebComPy.git#subdirectory=packages/webcompy"
uv add "webcompy-server @ git+https://github.com/kniwase/WebComPy.git#subdirectory=packages/webcompy-server"
uv add "webcompy-cli @ git+https://github.com/kniwase/WebComPy.git#subdirectory=packages/webcompy-cli"
uv run python -m webcompy initfrom webcompy.components import ComponentContext, define_component
from webcompy.elements import html
@define_component()
def HomePage(context: ComponentContext[None]):
return html.H1({}, "Hello WebComPy!")Prefer Poetry? See the